Input Form

INPUT - creates a form field (button, input box, checkbox, etc.), whose contents can be changed or activated by the user. The element has no ending tag. INPUT element must be inside the FORM element.

NAME - defines the name used when transferring the contents of the form to the server. This attribute is required for most types (attribute TYPE вАУ look below) of INPUT element and is commonly used to identify the field or group of fields related logically.

TYPE - specifies the type of field for inputting data. By default it is "text". Possible values:

text - creates a text boxfor one ext line. Typically used together with SIZE and MAXLENGTH attributes;

textarea - a field for inputting more than one text lines. But for this purpose TEXTAREA element is better to use;

file - enables tuser to attach a file to the current form. Can be used in conjunction with ACCEPT attribute;

password - creates a text box for a single line, but the inputted text is displayed as icons "*", thus hiding its contents from curious eyes;

checkbox - an input field for attributes of Boolean type ( "yes" / "no") or for attributes that can take multiple values simultaneously. These attributes are represented by a few checkbox fields that can have the same name. Each selected checkbox field creates a separate pair of name / value in the information sent to the server, even if there would be duplicate names as a result. The field of this type must have the NAME and VALUE attributes, as well as an optional attribute CHECKED that indicates that the field is selected;

radio - an input field for attributes that take on one of several possible values. All buttons (radio buttons) in the group must have the same names, but only the selected button in a group creates a pair of name / value, which will be sent to the server. As for the checkbox fields, CHECKED attribute is optional, it can be used to determine the selected button in the radio button;

submit - creates a button for sending information inputted into form to the server. VALUE attribute in this case changes the button marking, whose default value depends on the browser. If the NAME attribute specified, then when you press this button for the information sending to a server, a pair of name / value specified for attribute SUBMIT is added, otherwise the pair is not added;

image - creates a graphical button image that initializes the data transferring to the server. Location of the image can be set using the attribute SRC. When sending data a server gets the x and y coordinates of the point of image where a mouse button clicked. Coordinates are measured from the top left corner of the image. Meanwhile the information about the field of image type is stored in the form of two pairs of name / value. The name value is obtained by adding to the name of the appropriate field suffixes ". X" (abscissa), and ". Y" (ordinate);

reset - creates a button that drops the values of form fields to their default values. When you click it the data to the server are not sent. The button can be changed using the attribute VALUE. By default, the button marking depends on the browser version;

hidden - fields of this type will not appear on the screen that allows for placing "secret" information in the form. The content of this field is sent to the server as name / value along with the rest of the form information. This field is useful for sending data from script to script invisibly for user;

button - allows you to create a custom button to an HTML document that, with skilful use of JavaScript, adds more functionality to form. NAME attribute allows you to specify the name of the button, which can be used for any function in the script. VALUE attribute allows to specify the text displayed on the button in the document.

VALUE - defines text titles for the fields of any type, including buttons. For such fields as the checkbox or radio, will return to the value specified in VALUE attribute.

CHECKED - indicates that the checkbox and/or radio field types (see above attribute TYPE) are activated.

SIZE - determines the field size in characters. For example, to define a field with the apparent width of 24 characters, you must specify the SIZE = "24".

MAXLENGTH - defines the maximum number of characters that you can enter in the text box. It may be greater than the number of characters specified in the attribute SIZE. The default number of characters is not limited.

SRC - specifies the URL-address of the image used in the creation of graphical buttons. Used in conjunction with attribute TYPE = "image".

ALIGN - determines the way of vertical alignment for the image. Used in conjunction with attribute TYPE = "image". Completely analogous to attribute ALIGN of IMG element. The default value is вАШbottomвАЩ.

ACCEPT - specifies the type of file. Used only in conjunction with the parameter TYPE = "file". The value is a MIME-type.


<form action="all.php" method="POST">
<input name="secret" type="hidden" value="Hidden field" /> 
<input name="act" type="hidden" value="search" /> 
<input checked="checked" name="ppp" type="radio" value="My" /> I 
<input name="ppp" type="radio" value="NoMy" /> not I 
<input maxlength="60" name="textfield" size="30" type="text" value="My name" /> 
<input name="passwd" type="password" /> 
<input type="submit" value="Submit" /> 
<!-- FORM--> 
<!-- body--> <!-- html--> 
HTML Textarea
Form Processor
Select Form
Image in HTML page