JS

JavaScript Demos:
E-mail Feedback Form.

jim.cerny@unh.edu   13-AUG-1998


your name:
 *

your e-mail address:
 *

your feedback:
 *

 *required items.


Discussion.

This is taken from Heinle, Chapter 4. It does a basic validation of each element of a form. It checks to make sure each field is not blank and in the case of the e-mail address it also makes sure it contains an at-sign and a period. Things start to get more complicated in the scripting.

Please note the following:

  • You can see what gets submitted on the form by looking at View -> Document Info in Netscape (3.x).

  • The successfully validated form in this example is submitted to a CGI script at an NCSA site that will echo back a copy of what you submitted; presumably you would replace that with a local CGI script when your testing was complete.