![]() |
|
HTML input fields, Textbox and Textarea, Free online HTML Tutorial, Learn HTML online for free... |
| Lessons | Text box and Textarea |
|
||||||
|
Text Field: Text field or text box is used to enter text data. A text field is added to a web page as under: This is a text field <input type="text" name="text"> The output will be:
Most of the form elements are added using the <input> tag. The value of the type attribute specifies the kind of the element. The name attribute is used at the server-side to access the user entered data. Password Field: The password field can be added as under: This is a password field <input type="password" name="pw"> The output will be:
The password field is the same as the text field with only one difference. When entering data in a password field, the user cannot see it. The data appears as all asterisks (*). Textarea Field: The text field is a single line input field. If we want a multiline text input field we use a textarea field. The required code to add a textarea field is as under: This is a textarea field <textarea name="textarea" rows="10" cols="35"></textarea> The output will be:
The height and width of a textarea field can be controlled using the cols and rows attributes of the <textarea> tag. You can increase or decrease them in order to get a bigger or a smaller textarea field.
Next >>> Lesson No. 32: Radio, Select and Checkbox
|
|