Text Input Controls
There are three types of text input used on forms Single-line text input controls − This control is used for items that require only one line of user input, such as search boxes or names. They are created using HTML input tag.
Password input controls − This is also a single-line text input but it masks the character as soon as a user enters it. They are also created using HTMl input tag.
Multi-line text input controls − This is used when the user is required to give details that may be longer than a single sentence. Multi-line input controls are created using HTML textarea tag. Single-line text input controls This control is used for items that require only one line of user input, such as search boxes or names. They are created using HTML input tag.
Example
Here is a basic example of a single-line text input used to take a first name and last name
Syntax
<form>
First name : <input type= “text”…/>
<br>
Last name: <input type = “text” …. />
</form>
PARAMETER
Sr.No | Attribute & Description |
1 | type |
Indicates the type of input control and for text input control it will be set to text. | |
2 | name |
Used to give a name to the control which is sent to the server to be recognized and get the value. | |
3 | value |
This can be used to provide an initial value inside the control. | |
4 | size |
Allows to specify the width of the text-input control in terms of characters. | |
5 | maxlength |
Allows to specify the maximum number of characters a user can enter into the text box. |
Example for Form Input Control
<form>
First name : <input type= “text” name= “first name”/>
<br>
Last name: <input type = “text” name = “last name” />
</form>