webmaster resources tips and articles
webmaster information

Path = Home : Form Tips : How To Create A Text Field For A Form

How To Create A Text Field For A Form

 

A Text field will accept any type of alphanumeric text entry.

<input type="text" name="textfield">

 

Setting the size of the text field

You can set the size of the text field box by specifying the number of characters wide that it will be using the size property.

<input name="textfield" type="text" size="40">

 

Setting the maximum size of the text field

You can set the maximum number of characters that can be entered into the text field box using the maxlength property.

<input name="textfield" type="text" size="40" maxlength="60">

 

Setting a background color and text, font, size and color

You can set a background color and the text, font, size and color using the style property.

<input type="text" name="textfield" size="40" maxlength="60" style="color: #FF0000; font-family: Verdana; font-size: 12px; background-color: #FFFF66;">

 

Adding default text to the text field

You can add default text to the text field.

<input type="text" name="textfield" value="Default text" size="40" maxlength="60" style="color: #FF0000; font-family: Verdana; font-size: 12px; background-color: #FFFF66;">

 


 

 

© janim.net 2000 - 2008 All rights reserved