Attribute | Description |
---|---|
action | Specifies the encoding of the submitted data. |
enctype | Used to give a name to the control. |
method | Specify the method to be used to upload data. |
name | Used to identify and retrieve values from each form on the web page. |
target | Indicates the target of the address in the action attribute. |
Attribute | Description |
---|---|
Type | Specifies the type of input control. |
Name | Used to give a name to the control. |
Id | Used to identify the input field uniquely. |
Size | Used to specify the width of the text-input control in terms of characters |
Value | It is a default text or number that is displayed in the text field. |
Maxlength | Used to specify the maximum number of characters a user can enter into a input field. |
<!DOCTYPE html>
<html>
<head>
<title>Text Input Control Example</title>
</head>
<body>
<form >
Name: <input type="text" name="name" />
<br>
Mobile No: <input type="text" name="mob_no" />
</form>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>Password Field Example</title>
</head>
<body>
<form >
Name: <input type="text" name="name" />
<br>
Password: <input type="password" name="password" />
</form>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>Submit Button Example</title>
</head>
<body>
<form >
Name: <input type="text" name="name" />
<br>
Mobile No: <input type="text" name="mob_no" />
<br>
<input type="submit" value="Submit">
</form>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>Radio Button Example</title>
</head>
<body>
<form >
<input type="radio" name="gender" value="male"> Male
</br>
<input type="radio" name="gender" value="female"> Female
</form>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>Check Box Example</title>
</head>
<body>
<form >
<input type="checkbox" name="cricket" value="on"> Cricket
</br>
<input type="checkbox" name="hockey" value="on"> Hockey
</form>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>Multiple-Line Text Input Example</title>
</head>
<body>
<form>
<textarea rows="4" cols="30" name="address">
Text Area.....
</textarea>
</form>
</body>
</html>