Ensuring Two Form Fields Have Identical Information
By Will Bontrager2005-03-11
Integration Considerations
Form Name
The form's name in the example is "FormName", and the name is used in the JavaScript code, twice in each function. You'll find it in the JavaScript code with a period on each side of the name.
If you change your form's name, the name in the JavaScript must also be changed wherever it occurs.
To work with the JavaScript, the form's name must begin with an alphabet character. The rest of the name can be composed of any alphabet and/or number characters and/or underscore characters.
Field Names
The form field names in the example are "FieldA" and "FieldB". The field names are used in the JavaScript code, each field name once in each function. You'll find them in the JavaScript code with a period on each side of the names.
If you change either or both of your field names, the names in the JavaScript must also be changed wherever they occur.
The field names have the same restrictions as the form's name. They must begin with an alphabet character. The rest of the characters can be alphanumeric with the option of including underscore characters.
Alert Box Message
You may change the alert message in the JavaScript from "Oops, both fields must be identical." to something appropriate for your implementation. If your alert message includes quotation marks (other than the ones already at each end of the message), they must be escaped with a back slash. Example: \"
Tutorial Pages:
» Ensuring Two Form Fields Have Identical Information
» The Form
» The JavaScript
» Integration Considerations
» Form Fields with Un-Identical Information
Copyright 2004 Bontrager Connection, LLC
