Validating HTML form data

Dreamweaver can add JavaScript code that checks the contents of specified text fields to ensure that the user has entered the correct type of data.

Note: This feature only works with HTML forms. For ASP.NET forms, you can insert ASP.NET validation controls in Code view. For more information, consult the ASP.NET documentation.

To validate form data:

  1. Create a HTML form that includes at least one text field and one Submit button.

    Make sure every text field you want to validate has a unique name.

  2. Select the Submit button.
  3. In the Behaviors panel (Window > Behaviors), click the Plus (+) button and select the Validate Form behavior from the list.

    The Validate Form dialog box appears.



    Note: The Validate Form behavior is available only if a text field has been inserted into the document.

  4. Set the validation rules for each text field and click OK.

    For example, you might specify that a text field for a person's age accepts only numbers. For more information, see Validate Form.

Related topics


 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/dreamweaver/mx2004/using/41_for23.htm