29/09/2014

HTML The input tag

The input tag does not need an ending tag and can have numerous attributes:
text
password
radio
checkbox
reset
submit
HTML Text fields and passwords
Input
<input type="text" />
<input type="password" />
Output


Write something in the boxes above to note the difference.
HTML Checkboxes
Ideal for offering the user the option of selecting more than one answers
Input
<input type="checkbox" />
<input type="checkbox" />
<input type="checkbox" />

Output



HTML Radio
And I didn't mean a music radio, but a little circle which offers the possibility of choosing only one answer for a single question.
Input
<input type="radio" />
<input type="radio" />
<input type="radio" />

Output



HTML Submit buttons
Here, we will have to give a value to the submit attribute, this being the text that will be shown on the generated button.
Input
<input type="submit" value="Submit" />
<input type="submit" value="Next step >>" />

Output


HTML Reset Buttons
Here, same as with the submit button, we will have to give a value, that being the text that will be shown on the generated button. This button is extremely useful in the cases in which the user completes the majority of the forms with wrong information.
Input
<input type="reset" value="Reset" />
<input type="reset" value="Delete All " />

Output


HTML Input fields
Note: It must be specified that those forms and buttons will not fully act without the help of a php or javascript files that will execute the wanted action once one of these buttons is pressed. In the next tutorial we will go more in depth with the shown attributes and you will also show some things that we have not yet mentioned.
Have a nice time