CodeCharge Studio

Login Form

A Login form is used to enter authentication credentials when a user needs to access a restricted page or form. The login form contains a field for the username and another for the password. When the login form is submitted, its underlying code checks to make sure that the credential are authentic, after which the user can access the restricted page. If a user is not able to provide authentic credentials, they will not be able to proceed past the login form.

Just like the search form, a login form is basically a record form whose insert, update and delete properties have been disabled.

The easiest way to create a login form is to use the Authentication Builder. While it is possible to build a login form manually based on the barebones record form provided under the Forms tab of the Toolbox, it is hard to conceive why you would need to do that.

Before a login form can be created, you have to configure the project security settings under the Security and Security Groups tab of the Project Settings dialog window. These settings specify the database tables and fields that are used during the authentication process.

Login Form Properties

In design mode, a login form appears between the glyphs and . You can click on either of these glyphs to expose the login form properties under the Data tab of the Properties window. Alternatively, you can click on the name of the login form in the Project Explorer. Because a login form is basically a special type of record form, the login form properties are identical to those of a record form although most of these properties are left blank.

Login Form Properties

Property Description
Name A unique name for the form.
Connection A login form does not retrieve data from the database so this property is left blank. The Login form uses the database settings specified in Security tab of the Project Settings dialog window.
Source Type A login form does not retrieve data from the database so this property is left blank.
Data Source A login form does not retrieve data from the database so this property is left blank.
Return Page The page where the user will be redirected after successfully logging in. However, if the user was trying to access a restricted page or form, they will be redirected to the page they were trying to access prior to being redirected to the login page.
Remove Parameters Specify a common separated list of form or URL parameters which should not be propagated when the form is submitted.
Convert URL To Specify whether the URL should be automatically converted to an absolute URL or secure URL for the SSL protocol (https://).
Restricted This property should always be set to No since the user should be able to access the login form otherwise they would not be able to login.
Allow Insert This property is always set to No since the login form does not handle database content.
Allow Update This property is always set to No since the login form does not handle database content.
Allow Delete This property is always set to No since the login form does not handle database content.
Preserve Parameters Specify whether Get or Post parameters should be preserved when the form is submitted.
Custom Insert Type This property is always left blank since the login form does not handle database content.
Custom Insert This property is always left blank since the login form does not handle database content.
Custom Update Type This property is always left blank since the login form does not handle database content.
Custom Update This property is always left blank since the login form does not handle database content.
Custom Delete Type This property is always left blank since the login form does not handle database content.
Custom Delete This property is always left blank since the login form does not handle database content.

Login Form Actions

Since a login form is basically a scaled down version of a record form, there must be a special property which distinguishes the login form from other record forms. This special property comes in the form of a Login action which is placed on the OnClick Server event of the Login button located in the login form.

The Login action adds code to the page so that when the Login button is clicked, the added code calls a CodeCharge function which will perform the authentication operation and redirect the user based on the outcome of the login attempt. When you build a login form using the Authentication Builder the Login action is automatically added to the button. However, if you build the form manually, you can still add the Login action to the OnClick event of the Login button by selecting the action from the list of available actions.

When you build a Login form using the Authentication Builder, you also have the option of adding a SetFocus action which sets focus to the first field in the login form. This action is placed in the OnLoad client event of the page where the login form is contained. When the page loads at runtime, the action code moves the cursor to the first field in the login form so that the user can start typing immediately without having to manually move the cursor to the field.

The SetFocus action can also be added manually by selecting it from the list of available client actions.


On-line, printable versions and updates