HTML Tutorials
HTML Forms
HTML Basics

HTML Forms

Checkboxes and Radio Buttons

Here the gender and interests are selected with radio buttons and checkboxes respectively. They both use the <INPUT> tag with different types. Radio buttons are grouped by using the same name for them. Radio buttons may only have one selected item. The ability to select more than one is where the checkbox comes in.

Male Female
Interests: Sports TV Reading Computers

<INPUT TYPE="radio" name="gender" value="M"> Male <INPUT TYPE="radio" NAME="gender" value="F"> Female

<INPUT TYPE="checkbox" NAME="Sports">Sports
<INPUT TYPE="checkbox" NAME="Television">TV
<INPUT TYPE="checkbox" NAME="reading">Reading
<INPUT TYPE="checkbox" NAME="computers">Computers

The input type of submit creates a submit button that when pressed passes the information to the location in the ACTION portion of the <FORM> tag at the top. The VALUE portion of the submit button tag tells the browser what to display in the button. And ofcourse </FORM> ends the form.

<INPUT TYPE="submit" NAME="Submit" VALUE="Submit Form">
Structured Form Input <<  1 2 3 4
New Content