Update Record Form Wizard

The basic building blocks of an update page can be added in a single operation using the Update Record Form Wizard. The wizard adds an HTML form and an Update Transaction server behavior to your page. The form objects are laid out in a basic table, which you can customize by using the Dreamweaver page design tools (make sure all the form objects remain within the form’s boundaries). To edit the server behavior, display the Server Behaviors list (Window -> Server Behaviors) and double-click the Update Transaction server behavior.

You can also add the building blocks separately by using the form tools and the Server Behaviors tab of the Application panel. For more information on building an update page in multiple steps, see Update Record Transaction.

The Update Record Form Wizard is accessible from two locations:

 

The purpose of this wizard is to build a page that enables users to update records in a database table. This wizard is divided into two compulsory steps, based on the type of data the user has to input. If MX Form Validation has been installed, an additional step will need to be completed. This new step consists in defining the validation rules for all the fields included in the form generated by the wizard.

To build the update page with the Update Record Form Wizard, follow the next instructions:

  1. Open the page in Design view, and then apply the Update Record Form Wizard. A dialog box appears.
  2. Complete the dialog box, following the instructions below for each of the three steps:
    · Table and redirect information
    · Fields information
    · Form validation rules (if the MX Form Validation components have been installed).
  3. Click Finish when done.

Table and redirect information

The first step into completing the dialog box requires the user to input basic information about the transaction, like the table to be updated and the page to which it will be redirected:

 

To set the dialog box options, follow the next steps:

  1. In the Connection drop-down menu select the database connection defined for your site; if you don't have a connection yet, you can use the Define button and create one now.
  2. In the Update table drop-down menu select the database table into which you want to update records.
  3. In the Primary key column drop-down menu specify the primary key column for the current table. The content of this drop-down menu is refreshed each time the user changes the table for the update operation. By default, the first element is selected.
  4. The Numeric checkbox specifies whether the selected Primary key column has a numeric type (integer, double, etc). The state for this checkbox is altered each time the user changes the selected value of the Primary key column according to the meta-data retrieved by Dreamweaver for the specified table column.
  5. In the Primary key equals drop-down menu select the way the record ID is passed to the update page (either URL Parameter, Form Variable, Cookie, Session Variable, Server Variable, Entered Value), and type its name in the associated text-box.
  6. In the After updating, go to text box enter the page to be opened after the record is updated or click the Browse button to select the file page.
  7. The five buttons in the lower part of the interface offer you the next functionalities:
    · With the < Back / Next > buttons you can navigate through the wizard's steps.
    · Click Finish when you are done configuring the wizard.
    · Click Cancel to exit without the new settings to be applied.
    · The Help button brings you to this help page.
    These buttons appear on all three interfaces of the Update Record Form Wizard.
  8. Click Next to continue with configuring the wizard.

Fields information

This dialog box allows you to define exactly which fields get which data and where they get it from. This is where you will determine how an input for a specific field will be displayed as:

 

To set the dialog box options, follow the next steps:

  1. In the Form fields area specify the form objects you want to include on the HTML form of the update page, and which columns in your database table each form object should update.
    By default, ImpAKT3 creates a form object for each column in the database table. If your database automatically generates primary key ID's for each new record created, remove the form object corresponding to the primary key column by selecting it in the list and clicking the Minus (-) button. This eliminates the risk of the user changing the ID value.
    Use the Plus (+) button to add form fields to the current transaction.
    You can also change the order of the form objects on the HTML form by selecting a form object in the list and clicking the up and down arrows on the right top side of the dialog box.
  2. Specify how each data-entry field should be displayed on the HTML form by selecting a row (single click) in the Form fields area and entering the required information in the boxes below the grid.
  3. In the Label text box enter a descriptive label to display beside the data-entry field. By default, the column’s 'generic name' is displayed (MX Kollection 3 removes the part in the column name that starts with "_" and capitalizes the first part).
  4. In the Display as drop-down menu select a form object to serve as the data-entry field for the current selection in the grid. You can choose from the following list: Text field, Text area, Menu, Hidden Field, Check box, Radio group, Password field, Text, File field. To read the detailed description for each of these options, click here.
    Set the form object’s properties. You have different options depending on how you want the form field to be displayed as.
  5. You can use the Back button to alter the table and redirect information. If you do not wish to validate the user input, you can click on Finish to add the Update Record Form Wizard elements to the page. If you want to go to the third and last step of the wizard, click Next.

Form validation rules

This last step of the wizard configures the validation rules for each of the form input fields. You can define a rule for each form element, so that bad input will be avoided:

 

For instructions on completing this step, see Form Validation in wizards.

Remember that this step appears only if you have the whole MX Kollection 3 package installed, or even only MX Form Validation. In this case, an Validate Form trigger, with a validation role, will be added to your page.

 

Note: If in the first step of the wizard you have selected the user table that is also set in the Login Settings section of the Control Panel, and you've also set the password column to be displayed as a password field, the following will happen:

  1. Three different text fields will be generated for the password column: old password, password and re-type password.

  2. Two additional server behaviors will be added to the page:
    · The Check old Password server behavior.
    · A throw error trigger, that verifies if the old password and the re-type password fields match:



    If all of the password checks are successful, the update transaction is completed.