Help Buttons and Client-side Form Validation

If you deal with processing HTML forms, it is very useful to reduce server load by validating as much of the data that the user enters before it is submitted and to provide client-side help.

Example

Here we have a frontend to a database lookup where the reference value entered depends upon the database type selected. The script is used to provide help on the ranges that should be entered and to validate the value entered.

Click on the Help button to get pop-up help information. Try selecting a different database and press Help again to see how the help information displayed changes. Try entering an out of range value and pressing the submit button to see how the script picks up the error. Notice how the script even picks up an attempt at entering a numeric value where characters are expected.

Use your browser's 'View Source' command to view the example code.

Note that in practice you would need to complete the "action=" instruction in the form tag to name the server side script to process the data.

Call Center Database

Database selection

Reference

Click here to download the script

Click here to download the status bar script also used in the example