Monday, September 20, 2010

HTML Forms- now no more spammers fear

HTML Forms are one of the fragments of a document consisting of basic information, mark up and some specialized elements called ‘Controls’, which carry ‘labels’ upon themselves. Such controls may be Check-boxes, Menu, Radio buttons, and many more.

A form is generally completed by enhancing its Controls through ‘Enter text’, or ‘Selecting Menu Item’, and is then submitted to whomsoever concerned.

A Control has an initial value, and a current value, the two factors which eventually determine the value of the specified control. The initial value is fixed, but the current value may vary according to the scripts applied by the user. If the control does not have an initial value, the control is said to be dormant in the form.

The various types of controls present on HTML Forms are:

* Buttons- The ‘Submit’ button is used for the submission of a form, when completed. The ‘Reset’ button brings all the control values to their initial ones. The ‘Push’ button functions according to the requirement of the user, and in accordance with the event concerned.
* Check-boxes and Radio Buttons- They are similar to on/off switches, which only when turned ‘on’, are successfully submitted along with the form. The ones which are ‘off’ remain dormant all throughout.
* Menu- This control provides the user with a wide range of options to choose from.
* Text Input- HTML business forms allows users to input their choice of text, in reference to the required subject.
* File Select- Additional files which provide considerable reference to the context may also be selected along with the form.
* Hidden Controls- This control allows users to add files which are not visible with the form, but are actually submitted.

All the Controls are constrained inside a form element, which altogether specifies the basic layout of the HTML Forms, the program that handles the completed and submitted form. This element also denotes the format through which the data is to be sent to the server. In addition to the above, it also encodes the character for the server, necessary in order to access the form.

HTML Forms must be submitted to the processor using the HTTP methodology, as specified by the ‘method’ attribute of the concerned Form. There are two HTTP methods, namely, ‘get’ and ‘post’ methods. If the form causes some modifications in the processing unit, then a ‘post’ method is applied, otherwise, the ‘get’ is much more popular.

The steps to process the data from HTML forms are as follows –

* The successful controls of the given form are correctly identified.
* The current value of the successful controls is studied, and arranged in a sequence, called a form-data set.
* The form-data set is then sent for encoding according to the content type in the Form.
* Finally, the encoded data is sent to the processing agent using the specified protocol. But it may be up to the processor to render the form valid or not.

No comments:

Post a Comment