
Information
The Basics
Text
Pictures
Spacing
Colors
Links
Alignment
Lists/Bullets
Tables
Frames
Multimedia
Forms
ISO Characters
Meta Tags
Contact Us

Email Support
Email Contact
|
 |
 |
Introduction
Text fields are one of the most common fields you will see on the internet. They are a box on a web page that visitors are
able to select and type text into it. In this section you will learn the necessary tags to do this.
Text Field
The tag to put a text field on your web site is <INPUT TYPE="TEXT" NAME="XXXX">. XXXX is replaced with the name of
the field. This line goes within the starting and closing mandatory form tags.
|
index.html - Notepad |
....<BODY>
<FORM METHOD="POST" ACTION="script.cgi"><INPUT TYPE="TEXT" NAME="box1"> </FORM>
</BODY>....
|
|
|
My Homepage - Microsoft Internet Explorer |
|
|
Maximum Length
Maximum length specifies the maximum number of characters allowed in a text field. To specify maximum length, add the line
MAXLENGTH="X" to the <INPUT TYPE="TEXT" NAME="XXXX"> tag so the final result looks like
<INPUT TYPE="TEXT" NAME="XXXX" MAXLENGTH="X">. X is replaced with the number of characters allowed in the text
field.
|
index.html - Notepad |
....<BODY>
<FORM METHOD="POST" ACTION="script.cgi">
<INPUT TYPE="TEXT" NAME="box1" MAXLENGTH="5">
</FORM>
</BODY>....
|
|
|
My Homepage - Microsoft Internet Explorer |
|
|
Field Size
Field size specifies the width of the text field. To specify field size, add the line
SIZE="X" to the <INPUT TYPE="TEXT" NAME="XXXX"> tag so the final result looks like
<INPUT TYPE="TEXT" NAME="XXXX" SIZE="X">. X is replaced with the desired width of the field.
|
index.html - Notepad |
....<BODY>
<FORM METHOD="POST" ACTION="script.cgi">
<INPUT TYPE="TEXT" NAME="box1" SIZE="35">
</FORM>
</BODY>....
|
|
|
My Homepage - Microsoft Internet Explorer |
|
|
Initial Value
The initial value specifies what is already in the text field before the user edits it. To specify initial value, add the line
VALUE="X" to the <INPUT TYPE="TEXT" NAME="XXXX"> tag so the final result looks like
<INPUT TYPE="TEXT" NAME="XXXX" VALUE="X">. X is replaced with the desired initial value.
|
index.html - Notepad |
....<BODY>
<FORM METHOD="POST" ACTION="script.cgi">
<INPUT TYPE="TEXT" NAME="box1" VALUE="Welcome">
</FORM>
</BODY>....
|
|
|
My Homepage - Microsoft Internet Explorer |
|
|
Test Your HTML
|
|