This site uses cookies. By continuing, your consent is assumed. Learn more

120.9fm shares

Validating a registration form using javascript in adobe

opinion

In the first part of this series I introduced various forms of validation including some best practices, the difference between client-side and server-side validation, the types of validation including separation and indications for required fields, correct format, and confirmation fields.

Form validation: Create a simple...

If you have never created web forms with validation then I invite you to follow along with this tutorial for creating a simple form that will perform validation of several different text fields and one text area field on a web page. I am utilizing Dreamweaver and its Validate Form Behavior in my example here; however, any web editing tool can be used to accomplish the same tasks with similar results using the code snippets provided.

Note that the JavaScript portion might be a bit trickier without the tool, so I've included that code as well at the end of this tutorial.

In this simple form, no actual data will be submitted; we're only testing it for validation purposes.

In layman's terms, this means that we must tell the web authoring tool Dreamweaver when to check the form fields for valid data entry. In this case, we will tell Dreamweaver to execute the validation when the user clicks the Submit button in the form, utilizing the JavaScript "onSubmit" event for the client-side validation. In the dialog box that appears, click on the topmost field named NameField to highlight it. Now we can specify the validation parameters for this field.

News feed