EchoEcho.Com Homepage
Web Hosting - As Reliable As It Gets!
   Home > Tutorials > HTML > Forms


 Tutorials 
 D-Zine Articles 
 Online Tools 
 Free Resources 
 References 
 Quiz 
 Hosting 

















  HTML Forms :
TEXT FIELD








Text fields are one line areas that allow the user to input text.

If you want several lines you should use a text area instead.





SETTINGS:

Below is a listing of valid settings for text fields:


HTMLEXPLANATIONEXAMPLE
text
��size=
��maxlength=
��name=
��value=
��align=
��tabindex=

One line text field
Characters shown.
Max characters allowed.
Name of the field.
Initial value in the field.
Alignment of the field.
Tab order of the field.




The size option defines the width of the field. That is how many visible characters it can contain.

The maxlength option defines the maximum length of the field. That is how many characters can be entered in the field.
If you do not specify a maxlength, the visitor can easily enter more characters than are visible in the field at one time.

The name setting adds an internal name to the field so the program that handles the form can identify the fields.

The value setting defines what will appear in the box as the default value.

The align setting defines how the field is aligned.
Valid entries are: TOP, MIDDLE, BOTTOM, RIGHT, LEFT, TEXTTOP, BASELINE, ABSMIDDLE, ABSBOTTOM. The alignments are explained in the image section. You can learn about the different alignments here.

The tabindex setting defines in which order the different fields should be activated when the visitor clicks the tab key.




AN EXAMPLE:

Look at this HTML example:
<html>
<head>
<title>My Page</title>
</head>
<body>
<form name="myform" action="http://www.mydomain.com/myformhandler.cgi" method="POST">
<div align="center">
<br><br>
<input type="text" size="25" value="Enter your name here!">
<br><br>
</div>
</form>
</body>
</html>


And the resulting output from it:




 << PREVIOUS
READ MORE >>  
















DEVELOPER TIP!
FACT:
Table widths are MINIMUM settings in HTML. Therefore they sometimes span wider than you wanted.
TIP:
Enclose the table within another table. This ensures that the inner table does not stretch beyond the minimum size defined for the outer table.





     "Better Than Books - As Easy As It Gets!"


On EchoEcho: D-Zine Articles | Tutorials | Online Tools | Free Resources | References | Quiz | HostingAbout EchoEcho