Home / are more white girls dating black guys / Validating web form controls using dhtml

Validating web form controls using dhtml

DHTML allows scripting languages to change variables in a web page's definition language, which in turn affects the look and function of otherwise "static" HTML page content, after the page has been fully loaded and during the viewing process.Thus the dynamic characteristic of DHTML is the way it functions while a page is viewed, not in its ability to generate a unique page with each page load.An email address must contain at least a [email protected] sign and a dot (.).Also, the [email protected] must not be the first character of the email address, and the last dot must at least be one character after the [email protected] sign. There are two main methods for validating forms: (usually done using Java Script).Server-side validation is more secure but often more tricky to code, whereas client-side (Java Script) validation is easier to do and quicker too (the browser doesn't have to connect to the server to validate the form, so the user finds out instantly if they've missed out that required field! In this tutorial we'll build a simple form with client-side Java Script validation.

The application of DHTML was introduced by Microsoft with the release of Internet Explorer 4 in 1997.

In the above form, we are calling validate() to validate data when onsubmit event is occurring.

The following code shows the implementation of this validate() function.

Shows you how to write a script that ensures your form is filled in correctly before it's sent to your server.

Great for "required fields" such as email addresses!

243 comments

Leave a Reply

Your email address will not be published. Required fields are marked *

*