20-HTML Text Fields

0
269

This tutorial is all about HTML Text Fields.
Text fields present a small rectangular box that’s set to receive user’s information. When the users click these fields, the cursor will change from the arrow to a pipe character [ | ] allowing users type inside each input field.
A text field used <input> tag and the type attribute was set to “text”.
Example:

<form name=”myForm” action=”process.php” method=”post“>
First Name: <input title=”Please Enter Your Firstname” id=”fname” name=”fname” type=”text” />
Last Namte:  <input title=”Please Enter Your Lastname” id=”lname” name=”lname” type=”text” />
<input type=”submit” value=”Submit” />
</form>

 

Example on how to size and limit a text input:

<form name=”myForm” action=”process.php” method=”post“>
First Name: <input title=”Please Enter Your Firstname” id=”fname” name=”fname” type=”text”  size=”9″ maxlength=”4″/>
Last Namte:  <input title=”Please Enter Your Lastname” id=”lname” name=”lname” type=”text”  size=”15″ maxlength=”4″/>
<input type=”submit” value=”Submit” />
</form>

 

Example on how to set a value into a text input:

<form name=”myForm” action=”process.php” method=”post“>
First Name: <input title=”Please Enter Your Firstname” id=”fname” name=”fname” type=”text”  size=”9″ maxlength=”4″  value=”Janno”/>
Last Namte:  <input title=”Please Enter Your Lastname” id=”lname” name=”lname” type=”text”  size=”15″ maxlength=”4″ value=”Palacios”/>
<input type=”submit” value=”Submit” />
</form> 
 

 

Facebook Comments
(Visited 7 times, 1 visits today)

LEAVE A REPLY

Please enter your comment!
Please enter your name here