actually, i want to display back all checked value in checkbox..In my form, there is some checkbox element where the user should check necessary value b4 submit the form....My problem is, once the user has submit the from, i can't retrieved only checked value.....it display all value including unchecked value in checkbox....so, if anyone can help me, it would be great....thanks in advance......

Check this code:

<script>
function comparision(){
d=document.form2;
var total="";
if(!d.contype.length){
if(d.contype.checked) {
d.check_compare.value=d.check_compare.value+d.contype.value+',';
return true;
} else {
alert("Please select check Box");
return false;
}
}
for(var i=0; i < d.contype.length; i++){
if(d.contype[i].checked) {
#
total +=d.contype[i].value + "\n";
d.check_compare.value=d.check_compare.value+d.contype[i].value+',';
}
}

if(d.check_compare.value=="") {
alert("Please select atleast one check Box");
return false;
}
}
</script>

in the next page you should do like this:
$_POST;

And one more thing you have to add one hidden field like:
<input type=hidden name="check_compare" value="check_compare"> below your form tag starts....

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.