NOTE: This is a collection of information and links collected over the years that might provide useful information. A Safer Company LLC does not guarantee, endorse or approve any of these links or their scripts. Use these links to other websites at your own risk.
Validating a Form
Once you have your form completed, you should make sure that the fields in the form are validated. For example: if you have an email field, you want to make sure an email address was entered. There are many ways to validate a form using javascript. Dreamweaver makes it easy to validate a form.
- Open your form in Dreamweaver
- Select the field you want to validate. For example: you should validate email addresses.
- Go to Window and make sure Behaviors is
checked. Go to the Behaviors panel. Click on the + to
add behaviors. Select Validate Form.
- Your validate Form popup is displayed. Select the input "email" and
select that it is required and it is an email address and OK.
- Dreamweaver adds the following code that calls the javascript function
and passes parameters:
<input name="email" type="text" id="email" accesskey="e" onblur="MM_validateForm('email','','RisEmail');return document.MM_returnValue" size="30" maxlength="50" /> - Make sure you test these changes.
- If you are using Dreamweaver another option is to use
Dreamweaver
Spry.
NOTE: You do not need to use any other validation with Spry because it will validate when you submit your form.
Page last updated: May 31, 2012 10:27 AM
Content and Navigation...