HTML Forms
HTML Forms
By
Walujjo stephen
• An HTML form is used to collect user input. The
user input is most often sent to a server for
processing.
The <form> Element
<form>
<input type="radio" id="html" name="fav_language“
value="HTML">
<label for="html">HTML</label><br>
<input type="radio" id="css" name="fav_language“
value="CSS">
<label for="css">CSS</label><br>
<input type="radio" id="javascript" name="fav_language“
value="JavaScript">
<label for="javascript">JavaScript</label>
</form>
Checkboxes
The <input type="checkbox"> defines a checkbox.
If the name attribute is omitted, the value of the input field will not
be sent at all.
Example
This example will not submit the value of the "First name" input
field:
<form action="/action_page.php">
<label for="fname">First name:</label><br>
<input type="text" id="fname" value="John"><br><br>
<input type="submit" value="Submit">