HTML (English) 13 - සාමාන්‍යපෙළ තොරතුරු හා සන්නිවේදන තාක්ෂණය

HTML (English) 13

Input Element:

The INPUT element allows the user to type in a variety of different inputs such as text, checkboxes or buttons. The type of input element depends on the attribute TYPE. The default value of any field is determined by the attribute VALUE. Here are the different types of Input Elements and examples of each:

 

Text:

Displays a single line text field (for instance, an email address). The size of the field is specified by SIZE. You can also specify a MAXLENGTH attribute  which allows the user to input data longer than the  size: the text will scroll if the user exceeds the field size. SIZE and MAXLENGTH can be used in password also.

 

Checkbox:

Displays a box the user clicks on or off and returns a  value of "on or "off". The default value is specified by the attribute VALUE. For example:

                       

Submit:

Displays a Send Message button at the end of the form. Clicking this will send all the form data. Every form needs a submit button if you want to get any data.

                       

Hidden:

This input element is not displayed by the browser, but the contents of the hidden element are still sent to the server. This is useful for keeping track of what has happened previously as HTTP protocol does not keep any memory of past transactions. Usually the hidden value is placed in the form by a CGI program.

             

Image:

Places an active inline image whose URL is specified by the SRC command. Clicking the image submits the form including the coordinates of the mouse pointer.            

 

Password:

Offers a single line of text but the text typed is obscured by asterisks. The size of the password is specified by the attribute SIZE.

 

Radio:

Radio buttons are linked together by assigning them the same NAME. When you turn one radio button on, you turn all the other ones off. Each radio element must have a VALUE attribute, specifying "on" or "off".

 

Reset:

Displays a reset button that resets all the fields in the form to their default values.

 

Select Element:

The SELECT element creates a pull-down menu featuring a list of options the user must choose. SIZE specifies the number of displayed text lines. The default is 1, for more than 1 the list is displayed as a scroll box. The option selected is the value sent when the form is submitted. Having the attribute MULTIPLE within the SELECT element means more than one option can be selected.

Inside an option you can have the attribute DISABLED which displays that field as faded and is unselectable. You can also use the attribute VALUE within the options so that if that option is selected, your value is sent rather than the content of the option element.

Option 1

Option 2

... and so on ...

Last Option

 

 

Text area Element:

The TEXTAREA element allows the user to enter a message. If you put a message within the element, it will be displayed as an initial value.

 

Isindex Element:

Another type of form of a sort is the isindex element. It is not used within the FORM element. In fact, it is placed within the HEAD element of the HTML document, in the form



. This prompts the display in the user is browser: This is a searchable index. Enter search keywords:  with a text field for the user to input one or more words. This then sends the data to the server by appending the input data to the URL of the HTML document.