Skip to main content

Check Boxes in Html Forms

Check Boxes:
Check boxes are usually use to know the interest of any users. Suppose you want to know about users which type of fruits they like and you have 4 check boxes user either check one or more than one it's depend on user.

Attributes of Check Boxes:
type="checkbox"
name="something"
value="something"
checked="yes" or "no"

If you are making a list of fruits then name all the check boxes fruit which is essential for the script languages. Don't panic it's just a reference.

Check Boxes Example:
<p>Please select every fruit that you eat.</p>

Apple: <input type="checkbox" name="fruit" value="apple" /><br />
Banana: <input type="checkbox" name="fruit" value="banana" /><br />
Grapes: <input type="checkbox" name="fruit" value="grapes" /><br />
Cherry: <input type="checkbox" name="fruit" value="cherry" />
This is the code for making check boxes i made 4 check boxes have different values stored behind their check.
Check Boxes Example:

Please select every fruit that you eat.
Apple:
Mango:
Grapes:
Cherry:
Already Checked Code:
Grapes: <input type="checkbox" name="fruit" value="grapes" /><br />
Cherry: <input type="checkbox" name="fruit" value="cherry" checked="yes" />
Already Checked Example:
Grapes:
Cherry:
Just add another attribute to you check box checked="yes" then it will already selected shown to user. It's use in must select this, choices that it has to be selected.

Comments

Popular posts from this blog

Manipulating WW2 Fire AirCraft

In this tutorial we will be learning some indispensable techniques to use for any type of photo-manipulation. We will be doing this by taking a photograph of a model plane and editing it to to look like a photograph of a WW2 spitfire which has just been shot down and is on fire. The techniques used here are the same for any type of 'destruction' photo-manipulation. Below is the link you will learn how to create. In the second part of this tutorial we will go on to use this image in a movie poster/DVD cover design View Tutorial

Simple Hit counter

A hit counter will let us know how many times a page is accessed. Incase one visitors loads the page several times, the hit counter willincrease several times (but this is likely to happen only a few times). The code for the hit counter bellow will save the number of hits in afile named counter.txt (the name of this file may be changed). Each time the page is loaded,the file will be read, the number will be increased by one and the newnumber will be saved to the same file. Counter.php <?php //The file where number of hits will be saved; name may be changed;p.e. "/counter_files/counter1.txt" $counterfile = " counter.txt "; // Opening the file; number of hit is stored in variable $hits $fp = fopen($counterfile,"r"); $hits = fgets($fp,100); fclose($fp); //increading number of hits $hits ++; //saving number of hits $fp = fopen($counterfile,"w"); fputs($fp, $hits ); fclose($fp); //printing  hits; you may remove next lin...

Italics in Html

The italics tags use to highlight the fonts but not like bold it makes your font just like dance a step. These tags are not intended to to style your font. It's use to emphasize your fonts. Code: Italic <i>tag</i>! <em>Emphasized</em> Text! Example: Italic tag ! Emphasized Text! Code: <b>HTML</b> <i>Hyper Text Markup Language</i>  or <b>HTML</b> <em>Hyper Text Markup Language</em> Example: HTML Hyper Text Markup Language or HTML Hyper Text Markup Language Code: <p>Johnson is <b><i>DR.</i></b></p> Example: Johnson is DR.