Applying the Server Validations server behavior

The Server Validations server behavior performs validation against the value of server variables as they are submitted to the server. The server behavior can be configured to perform validations when the page is loaded, a specified form is submitted to the page, any form on the page is submitted, or a submit button for a specific form is clicked.

The Server Validations dialog allows you to configure multiple validations for one of the given triggers. Validations are configured by selecting a validation type and the server variable it is to check. Clicking the Plus (+) button opens the configuration dialog specific to that validation. Upon completing configuration, the new validation is listed in the display window. See Available server validations for a complete list of the server validations and information specific to their configuration.

Upon performing the specified validations on the server, the page will redirect to a specified location. Errors found can be specified on the same page or on a different page. See the Validation Show If server behavior for information on error-handling and displaying errors found by the Server Validations server behavior.

To apply the Server Validations server behavior to a the page:

  1. In Dreamweaver, open the page that the server behavior is to be applied to.

    You may apply the server behavior to the same page a form to be validated resides on. In this scenario, the form action must submit the page to itself.

    If using a separate page to perform validation for a form, the form action must point to that page.
  2. From the WebAssist menu, choose Forms > Validation > Server Validations.

    The Server Validations dialog opens:

To configure the Server Validations server behavior:

  1. Select the Validation trigger which will start the validations applied in the server behavior. The following triggers are available:
    • On Form Submit: Any form submitted on the same page that the server behavior is applied to will trigger validation. This is used typically when applying the server behavior to the same page that a form to be validated resides on, such as when a client fills out a contact us page and needs to make changes on the same page to properly submit the form.
    • Any Form Post: Any form posted to the page that the server behavior is applied to will trigger validation. This is typically used when a form on a different page is submitted to the page for validation, such as when a when a results page evaluates search criteria submitted from another page.
    • Before Page Load: Validation is triggered when the page the server behavior is applied to is loaded. This is used typically to determine that server variables with unknown content that are to be used by the given page can be used properly by the page before it tries to use them. This is typically used to check information retrieved from a database that needs to be in a specific format, such as Date and/or Time.
    • Submit buttons on the page: All Submit buttons on the page the server behavior is applied to are available as triggers for the validation. This allows you to configure the validation specific to the submission of a specific form on the page, useful when multiple forms and multiple applications of the server behavior are present on the same page.
  2. Select a validation type to be configured for the server behavior. The section Available server validations lists all validations available for this server behavior.
  3. Specify the server variable to be validated for the selected validation type. You may either enter the variable string directly, or click the lightning bolt to select from a list of available variables, which will define the variable string for you.
  4. Click the Plus (+) button.

    The configuration window for the validation type selected will open. Information specific to each validation type is available in the Available server validations section.
  5. Complete configuration of the validation and Click OK.

    The dialog will display the configured validation.
    • You may remove a configured validation by selecting it and clicking the Minus (-) button.
    • You may edit the configuration of a configured validation by selecting it and clicking the Update button.
  6. Repeat steps 2 thru 5 for all validations to be configured for this application of the server behavior.
  7. Specify the page the server behavior will redirect to when a validation fails. You may leave this blank if redirecting to the same page.

    Note: The page redirected to should perform error-handling specific to the validation using the Validation Show If server behavior to display error messages.
  8. Click OK to apply the server behavior.