HTML Text Fields
HTML uses various input forms and text is one of them.To learn about HTML Forms in detail click here.
HTML What Is Text Field
Text fields are used to input data from the user.These inputs from the user are submitted and
sent to the server.Example:
First Name:
Last Name:
To learn more about other HTML forms click on the following:
Creating Text Field In HTML
We have discussed about why text fields are used in webpages.
Now we will learn how to create them.
<html>
<body>
<form>
First Name:<input type="text" name="First Name"/>
Last Name:<input type="text" name="Last Name"/>
</form>
</body>
</html>
Note:The above code creates a single line text field.
<html> <body> <form> First Name:<input type="text" name="First Name"/> Last Name:<input type="text" name="Last Name"/> </form> </body> </html>
Creating Textpad In HTML
We learned how to create single line text fields.Now we will create a text
pad of any size we want.We can create a text pad with customizing the number
of rows and columns in it.Here is the code for it:
<html>
<body>
<form>
<textarea rows="5" columns="8">
You can change number of rows and columns
according to your choice.
</textarea>
</form>
</body>
</html>
The browser would display the textarea as:
<html> <body> <form> <textarea rows="5" columns="8"> You can change number of rows and columns according to your choice. </textarea> </form> </body> </html>
Previous:HTML Tables Next:HTML Styles
