Forms in HTML documents
The some people WWW browser allow the user, having filled in the special form returning received value to carry out some actions on yours WWW - the server. When the form is interpreted WEB - by a browser, created special screen elements GUI, such, as fields of input, checkboxes, radiobuttons, dropping out menus, skrolliruemye lists, buttons, etc. When the user fills in the form and presses button " Acknowledgement{Confirmation} " (SUBMIT - the special type of the button which is set at the description of the document), the information entered by the user in the form, is sent the HTTP-server for processing and transfer to other programs working under the server, according to CGI (Common Gateway Interface) the interface.
When you describe the form, each element of data input has a tag <INPUT>. When the user places the forms given in an element, inforomacija is placed in section VALUE of the given element.
Syntax
All forms begin a tag <FORM> and zvershajutsja a tag </FORM>.
<FORM METHOD = "get|post" ACTION = "URL"> EHlementy_formy_i_drugie_ehlementy_HTML </FORM>
METHOD
Method of a parcel{sending} of the message with the data from the form. Depending on a used method you can send results of data input in the form two ways:
* GET: the Information from the form is added in end URL which has been specified in the description of heading of the form. Your CGI-program (CGI-script) obtains the data from the form as parameter of variable QUERY_STRING environment. Use of method GET is not recommended.
* POST: the Given method passes the information on the form immediately after the reference{manipulation} to specified URL. Your CGI-program obtains the data from the form in a standard stream of input. The server will not send you the message on the termination{ending} of transfer of the data to a standard stream of input; instead of it the variable of CONTENT_LENGTH environment for definition is used, what quantity{amount} given to you is necessary for counting from a standard stream of input. The given method is recommended to use.
ACTION
ACTION describes URL which will be caused for processing the form. Given URL almost always specifies the CGI-program processing the given form.
Tags of the Form
TEXTAREA
The tag <TEXTAREA> is used to allow the user to enter more one line of the information (the free text). An example ispol`zovani a tag <TEXTAREA>:
<TEXTAREA NAME = "address" ROWS=10 COLS=50> Moscow, highway Dmitrovkoe, d.9B, office 448 </TEXTAREA>
The attributes used inside a tag <TEXTAREA> describe appearance and a name of entered value. The tag </TEXTAREA> is necessary even then, when a field of input initially empty. The description of attributes:
* NAME - a name of a field of input
* ROWS - height of a field of input in symbols
* COLS - width of a field of input in symbols
If you want, that in a field of input any text it is necessary to insert it{him} inside tags <TEXTAREA> and </TEXTAREA> was by default given out.
INPUT
The tag <INPUT> is used for input of one line of the text or one word. Attributes of a tag:
* CHECKED - means, that CHECKBOX or RADIOBUTTON it will be chosen.
* MAXLENGTH - defines{determines} quantity{amount} of symbols which users can enter into a field of input. At excess of quantity{amount} of allowable symbols the browser reacts to attempt of input of a new symbol by a sound signal and does not give it{him} to enter. To not confuse to attribute SIZE. If MAXLENGTH it is more than SIZE in a field it is carried out skrolling. By default value MAXLENGTH is equal to infinity.
* NAME - a name of a field of input. The given name is used as the unique identifier of a field on which, subsequently, you can obtain the data placed by the user in this field.
* SIZE - defines{determines} the visual size of a field of input on the screen in symbols.
* SRC - URL. Specifying a picture (it is shared with attribute IMAGE).
* VALUE - appropriates{gives} to a field a default value or value which will be chosen at use such as RADIO (for type RADIO the given attribute it is obligatory)
* TYPE - defines{determines} type of a field of input. By default this simple field of input for one line of the text. Other types should be obvious, their full list is resulted below:
CHECKBOX
It is used for simple logic (BOOLEAN) values. The value associated with a name of the given field which will be passed in the caused CGI-program, can accept value ON or OFF.
HIDDEN
Fields of the given type are not displayed by a browser and do not give the user to change prisvoennyedannomu to a field by default value. This field ispol`zuets for transfer to the CGI-program of the static information, as that ID prol`zovatelja, the password or other information.
IMAGE
The given type of a field of input allows you to connect graphic figure with a name of a field. By pressing by the mouse any part of figure the CGI-program associated to the form will be immediately called. The values appropriated{given} by variable NAME will look so - is created two new variables: the first has a name designated in field NAME with addition .x at the end of a name. In this variable the X-coordinate of a point in pikselakh will be placed (considering the beginning of coordinates the left top corner of figure) which specified the cursor of the mouse at the moment of pressing, and the variable with a name contained in NAME and added .y, will contain Y-coordinate. All values of attribute VALUE are ignored. The description of a picture is carried out through attribute SRC and on syntax coincides with a tag <IMG>.
PASSWORD
The same, as attribute TEXT, but value entered by the user is not displayed by a browser on the screen.
RADIO
The given attribute allows to enter one value from several alternatives. For creation of a set of alternatives it is necessary for you to create some fields of input with attribute TYPE = "RADIO" with different values of attribute VALUE, but with identical values of attribute NAME. Value will be transferred{handed} to the CGI-program such as NAME=VALUE, and VALUE will accept value of attribute VALUE of that field of input which at present will be chosen (will be active). At a choice of one of fields of input such as RADIO all other fields of the given type with the same name (attribute NAME) automatically become non-withdrawn on the screen.
RESET
The given type designates the button by which pressing all fields of the form will accept the values described for them by default.
SUBMIT
The given type designates the button, by which pressing the CGI-program (or URL), described in heading of the form will be called. Attribute VALUE can contain a line which will be highlighted on the button.
TEXT
The given type of a field of input describes an one-line field of input. Use attributes MAXLENGTH and SIZE for definition maximal are long entered value in symbols and the size of a displayed field of input on the screen (20 symbols by default are accepted).

|