Validating a form using javascript

Rated 4.95/5 based on 947 customer reviews

You can avoid these headaches once and for all with Java Script's amazing way to combat bad form data with a technique called "form validation".The idea behind Java Script form validation is to provide a method to check the user entered information before they can even submit it.Remember to check out Tizag's HTML forms lesson if you need to brush up on your form knowledge.

For example, suppose your user submits the form without entering a mandatory field.Java Script also lets you display helpful alerts to inform the user what information they have entered incorrectly and how they can fix it.In this lesson we will be reviewing some basic form validation, showing you how to check for the following: This lesson is a little long, but knowing how to implement these form validation techniques is definitely worth the effort on your part.Any interactive web site has form input - a place where the users input different kind of information.This data is passed to ASP script, or some other technology and if the data contains an error, there will be a delay before the information travels over the Internet to the server, is examined on the server, and then returns to the user along with an error message.

Leave a Reply