Validating data in javascript

Knowing the limits of client-side scripting helps you decide whether to use client-side form validation.

This article explains how to provide client-side validation for forms that you create either by hand or by using the form tools within Front Page.

Microsoft® Office Front Page® 2003 allows you to create some custom validation within the form feature.

Both Java Script and JScript are ECMAScript-compliant languages.Lisa Wollin Microsoft Corporation May 2004 Applies to: Microsoft® Office Front Page® 2003 Microsoft Front Page 2002 Microsoft Front Page 2000 Summary: Learn how validate HTML form fields using Java Script in Microsoft Office Front Page 2003.This article assumes a general understanding of HTML and Java Script.However, client-side validation may not work in all instances.A user may have a browser that doesn't support client-side scripting or may have scripting disabled in the browser.Because the code is stored within the page or within a linked file, it is downloaded into the browser when a user accesses the page and, therefore, doesn't require a roundtrip to the server.For this reason, client form validation can be faster than server-side validation.In this table, Element refers to the name of the HTML element for the form field, Type refers to the value of the type attribute for the form field, and Label refers to the text to the left of the form field. Form code updated with name attribute values Now that you have assigned names for the form and form fields, you are ready to start writing the script that handles the validation for the fields. If you are typing the Java Script code in this article manually and receive errors, you should check that all casing is the same as shown in this article.Otherwise, you may want to review JScript Run-Time and Syntax errors.When referring to Java Script in general, this article uses the generally accepted term "Java Script." However, when referring to documentation on the Microsoft Developer Network (MSDN) Web site, this article uses the term "JScript." Note The previous code specifies an e-mail address for the Action attribute of the form property.For more information, see ACTION Attribute | action Property and form property.