HTML Checkboxes

HTML Checkboxes Form
Check boxes let the user to select the ONE or More Options.We use the <input type="checkbox"/> to define the check boxes.We set the type the type attribute  of an <input> tag  for checkboxes to places into the web pages.Now
Example:

<form name="HTML Form" action="mailto:youremail@email.com" method="post">
<p>Select every sport that you play.</p>

Football: <input type="checkbox" name="sports" value="Football"  /><br />

Cricket: <input type="checkbox" name="sports" value="Cricket"  /><br /> 

Soccer: <input type="checkbox" name="sports" value="Soccer"  /><br /> 

Basketball: <input type="checkbox" name="sports" value="basketball"  />

</form>

Your Result:

Select every sport that you play.
Football: 
Cricket: 
Soccer: 
Basketball: 

HTML Checkboxes Selected
We use a pre-checked fashion to display the boxes with check mark in a web page by setting the check attribute with "yes" value.By doing so when we load the page the boxes always appear with the check mark function.now see the example
Example:

<form name="HTML Form" action="mailto:youremail@email.com" method="post">
<p>Select every sport that you play.</p> Football: <input type="checkbox" checked="yes" name="sports" value="Football" /> <br /> Cricket: <input type="checkbox" name="sports" value="Cricket" /> <br /> Soccer: <input type="checkbox" name="sports" value="Soccerl" /> <br /> Basketball: <input type="checkbox" checked="yes" name="sports" value="basketball" />
</form>


Your Result:
Select every sport that you play.
Football: 
Cricket: 
Soccer: 
Basketball: 

No comments:

Post a Comment