ITSourceCode.com

We Exist to Provide 100% Free Source Code and Tutorials

Custom Search

20-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

Check Your Domain Ranking

Leave a Reply

Your email address will not be published. Required fields are marked *

ITSourceCode.com © 2016 Frontier Theme

Subscribe For Latest Updates

Signup for our newsletter and get notified when we publish new articles for free!