Developing Reusable Form Creation Routines
As promised, in this section we will examine reusable methods to create HTML forms with the proper form fields, complete with client-side form validation. These methods will hide the specific details of properly naming form fields and will not bother the developer with creating client-side form validation routines.
Form Implementation Complexity
creating a form is a trivial task; it’s just a matter of HTML
coding. However, due to our reusable server-side validation code,
creating a form has become a much more complex issue. When using a
global server-side form validation page that all forms initially
submit to, all the forms need to follow a certain standard.
of each form element that
requires form validation must contain an exclamation point followed
by the validation regular expression. Furthermore, the form’s
property must direct to the validation
/CODEREUSE/ValidateForm.asp) and pass two
Remembering these specific details is cumbersome and serves as an
easy place to make a mistake, resulting in a bug. Also, if other
developers are to be working on creating the HTML forms, they will be
less familiar with the conventions specified by the server-side form
As discussed earlier, client-side form validation is a nice option, although not as critical as server-side form validation. As with server-side form ...