![]() |
JavaScript Form Validator
|
||||||||||||||
|
Home > Toys > Here This JavaScript program performs several checks on the data in the form below. If none of the specified input fields have data, the JavaScript program will ask for confirmation prior to submitting the data to the web server. Used in this way, part of the form validation for large, multi-field, or complicated host application screens can be performed on the browser end. In this example form, the 'Full Name Field' should have something it before the 'Submit' button is clicked. If this is not the case, a JavaScript 'confirm()' box will be displayed along with a message about which input field needs to be addresed. Given the nature of the input tag names can exist, a mapping of 'x12y3' to a name 'Full Name Field' is accomplished in the JavaScript. This is an unfortunate pre-processing cost of this JavaScript program. All fields of each form that you care to use this JavaScript program on will have to be cataloged, mapped (weird to field name) and either a separate modified copy of this JavaScript program will have to be created, or a more ambitious use of a server side include would have to be attempted.
|
||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
||||||||||||||