Click here to learn more about form field validation. Another important use is in combination with cookies that should be set upon arrival or leaving your pages. F or example, you might have a popup asking the user to enter his name upon his first arrival to your page. The name is then stored in a cookie. Furthermore, when the visitor leaves your page a cookie stores the current date.
C lick here to learn more about setting cookies.
Click here to learn more about popup boxes. This is a clear break of netiquette, and is not considered proper webdesign. S ometimes however, the visitor might find it annoying to have validations in the middle of entering fields on a form. Rather than validating after each input, you might want the form to be validated only upon clicking the submit button. T his can be done using the onSubmit event.