JavaScript code runs on the user's machine, making it an ideal method to perform simple verification on form data before submitting it on to the server. Performing the checks on the client side saves the user from waiting for the data to travel way back to the server, and then (if there's a problem) waiting again for an error message. |