The client-side is what's on the user's browser and machine. It's what they see (largely a matter of text, images, video, XML, HTML, and CSS) and the code on the page (usually JavaScript). This section deals primarily with the HTML tags related to forms and the JavaScript for validating forms.

There are 10 HTML tags for forms. Some are for grouping or meta data, but the primary form tags are "controls", i.e. a thing that a user can see and interact with.

Most form controls correspond to a single name/value pair. EG: The Email text control may have a field name of "Email" and a user entered field value of "JohnSmith@gmail.com". However, the checkbox and select/option controls are different in that they can represent an array or list of data. EG: The Pet checkbox control may have field name of "Pet" and user chosen values of "Cat" and "Dog". Note that although a radio control provides several choices, only one can be chosen.

If you were to access a form with all the form elements above (with something like for(var i=0; i<document.form[0].elements.length; i++){alert("Element name: "+document.form[0].elements[i].name+ " Element Type: " + document.form[0].elements[i].type + "\n";), then you would get the following element types: text, password, hidden, checkbox, radio, submit, reset, button, image, file, select-one, select-multiple, and textarea.

Client-side validation is usually done with JavaScript. While client-side validation is useful for making sure that user fill out the form properly, malicious hackers can skip the clien-side validation and pass values directly to the server. Hence there server-side validation is needed as well.

Page Modified: (Hand noted: ) (Auto noted: )