Show All

Creating a modification block

A modification block is a database-driven form that is used to modify an existing record in a database. The form is contained in a table.

Namo Web Editor 8.database.input.1.1 Creating a modification block

A simple modification block in Preview mode

Namo Web Editor icon reveal Creating a modification blockStarting the Database Wizard
  1. Place the insertion point anywhere in the current document.
  2. On the Develop menu, go to Database, click Block, and then click Modification Block.
Namo Web Editor icon reveal Creating a modification blockStep 1: Document Type
  1. Click the Script type box and select the dynamic document standard you want to use.
  2. Click the Database box and select the appropriate connection method for your database. (If you chose ASP as the script type, you will only be able to select ODBC.)
  3. Click Next.
Namo Web Editor icon reveal Creating a modification blockStep 2: Data Source
  1. Do one of the following, depending on your selection in the Database box in Step 1 of the wizard:
    • If you chose ODBC: Click the Data source box and select the ODBC data source corresponding to your database.
    • If you chose MySQL:
      1. In the MySQL host box, enter the hostname or IP address and port number of your MySQL server, replacing the text within brackets. Also delete the brackets.
      2. In the MySQL DB name box, enter the name of your MySQL database.
    • If you chose one of the JDBC connection methods (for a JSP document): In the Data source URL box, replace the parameters in brackets with appropriate values for your database. Also delete the brackets.
  2. If your data source or database is password-protected, fill in the User ID and Password boxes.
  3. If you chose a connection method other than ODBC in Step 1 of the wizard, click the ODBC DSN for preview box and select the ODBC data source corresponding to your database.
  4. Click Next.
Namo Web Editor icon reveal Creating a modification blockStep 3: Database Fields
  1. For each database field you want to include in the modification block, select the field in the box on the left and click Add. To add all the fields in a table, select the table and click Add. (Note: for a modification block, you can only include database fields from one table only. The wizard will not allow you to include fields from multiple tables.)
  2. Click Next.
Namo Web Editor icon reveal Creating a modification blockStep 4: Selection Statement
  1. In the Filter box, enter a filter condition to select the record to be modified. (For information about configuring a modification block to display a specific record depending on the value of a parameter in the URL, see “Using parameters with database-driven documents“.)
  2. Click Next.
Namo Web Editor icon reveal Creating a modification blockStep 5: Block Elements
  1. If you want to remove one or more unnecessary block elements, select each and click Remove.
  2. Click Next.
Namo Web Editor icon reveal Creating a modification blockStep 6: Input Method
  1. Click either the GET option or the POST option, depending on how you want the browser to submit the data in the modification block to the Web server. POST is usually preferable, since this method imposes no limit on the amount of data that can be submitted. Choose GET only if you have a specific reason to do so.
  2. In the Result page URL box, enter an optional path or URL for a result page. If you leave this box empty, users will see a simple “Input process complete” message when they submit the input form. A more useful result page might be a document that contains a table block or list block displaying the latest records in the database table that was just updated.
  3. Click Finish.

When you finish the Database Wizard, the modification block will be inserted into the current document. In Edit mode, the block will initially look something like example below:

Namo Web Editor 8.database.input.1.2 Creating a modification block

Example of an modification block in Edit mode before modification

The input elementA form field in an input block. An input element accepts user data that will be inserted into a database. placeholders in the right column are shown with example values that indicate the type of the input element. To change the properties of an input element, double-click it.

The default element labels in the left column are simply the names of the database fields you selected in Step 3 of the wizard. Since these labels are static, plain text, you can replace them with any content you want.

You can replace a box-type input element with a database-driven drop-down menu or radio button group. This is useful when you want to restrict the values users can input in a particular database field, or you want to display a menu of possible selections instead of forcing users to enter a numeric value (such as Orders.Product in the example above).

You can format a modification block as you would an ordinary table. You can also format the text inside it and add static content, such as images. For more information about formatting a block, see “Formatting database-driven content“.

Related topics

Using parameters with database-driven documents

Modifying input element properties

Working with block elements

Replacing an input box with an input control

Formatting database-driven content

Creating a modification block