Monday, 26 October 2015

HTML input type

                                     HTML input type

Input Type: text

<input type="text"> defines a one-line input field for text input:
example:
<form>
First name:<br>
<input type="text" name="firstname">
<br>
Last name:<br>
<input type="text" name="lastname">
</form>
This is how the HTML code above will be displayed in a browser:
First name:

Last name:


Input Type: password

<input type="password"> defines a password field:

<form>
User name:<br>
<input type="text" name="username">
<br>
User password:<br>
<input type="password" name="psw">
</form>

This is how the HTML code above will be displayed in a browser:
User name:

User password:

Input Type: submit

<input type="submit"> defines a button for submitting form input to a form-handler.
The form-handler is typically a server page with a script for processing input data.
The form-handler is specified in the form's action attribute:

<form action="action_page.php">
First name:<br>
<input type="text" name="firstname" value="Mickey">
<br>
Last name:<br>
<input type="text" name="lastname" value="Mouse">
<br><br>
<input type="submit" value="Submit">
</form>

This is how the HTML code above will be displayed in a browser:
First name:

Last name:




Input Type: radio

<input type="radio"> defines a radio button.
Radio buttons let a user select ONLY ONE of a limited number of choices:
<form>
<input type="radio" name="sex" value="male" checked> Male
<br>
<input type="radio" name="sex" value="female"> Female
</form>

This is how the HTML code above will be displayed in a browser:
 Male
 Female

No comments:

Post a Comment