HTML | Tags and Attributes [FORM] [Text and Input Box]


Ü How to include Text Fields or Input Fields?
            To include a text field we will input the <INPUT> tag in between the <FORM>....</FORM> tags. Consider the following,
            <INPUT TYPE=”....” NAME=”....” VALUE=”....” SIZE=”...” MAXLENGTH=”....” >
            The uses of the various attributes in the above code are given below
.
Attribute
Use
TYPE=”....”
The value of this attribute in the case of text filed will be TEXT.
NAME=”....”
Here, the value is to label the content. It does not appear. But the value of this attribute should have to be unique in a form.
VALUE=”....”
In the case of text fields, whatever we give as a value of the VALUE attribute appears initially in the text field. That is, if we write VALUE=”TANMAY”, TANMAY will initially appear in the text field.
SIZE=”..”
The value of this attribute actually indicates the size of the text field. The values are given in numbers.
MAXLENGTH=”..”
The value of this attribute actually defines the maximum number of characters which will be taken as input.
Now consider the following input and output.
Input :
<HTML><HEAD><TITLE> FORM </TITLE></HEAD>
<BODY>
<FORM>
Please input the informations -- ---<BR>
<INPUT TYPE="TEXT" NAME="firstname" VALUE="First name"SIZE="30" MAXLENGTH="50">First Name <BR>
<INPUT TYPE="TEXT" NAME="lastname" SIZE="30" MAXLENGTH="50">Last Name <BR>
<INPUT TYPE="TEXT" NAME="emailadd" SIZE="30" MAXLENGTH="100">E-mail address<BR>
<INPUT TYPE="TEXT" NAME="add" SIZE="30" MAXLENGTH="300">Address <BR>
</FORM></BODY></HTML>

Output:



Author: Tanmay Chakrabarty

Tanmay Chakrabarty is a former CSE student, currently working as a Senior Software Engineer with 5+ years of experience in the field of Web Application development in PHP+MySQL platform with strong skills in Javascript, JQuery, JQuery UI and CSS. He tries to write notes every week but fails due to heavy loads of duty.

Recommended Recommends

Comments

Contact Us