HappyLife.In

HappyLife.In
happylife

Wednesday, January 6, 2010

Array Check box validation

Hi all,


Array Check box validation ...


<html>
<head>
<script type="text/javascript">
function validate_array_checkbox(form_object,checkbox_name){
var total=0;
for(var i=0; i < form_object[checkbox_name].length; i++)
{
if(form_object[checkbox_name][i].checked)
{

return true;
}
}
alert("Please select your place") ;
return false;
}
</script>
</head>
<body>
<form method="post" onSubmit="return validate_array_checkbox(this,'pl[]');">
<input type="checkbox" name="pl[]" value="Chennai" />Chennai
<input type="checkbox" name="pl[]" value="Madurai" />Madurai
<input type="checkbox" name="pl[]" value="Delhi" /> Delhi
<input type="submit" value="Validate" />
</form>
</body>
</html>

No comments:

Post a Comment

Post a Comment

Select All,Select None,Select Invertion

Select All Select None Invert Selection

Add to basket JQUERY

Image Fly To Basket
Add to cart
Code take from jbasket fly to basket site,,,,