It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

News

Log In Sponsors
Partner Sites

Re: validate checkbox



Here's a basic example:
[code:3u2g87hi]
<script type="text/javascript">
var ray=
{
validate:function(el)
{
var chckArr = el.getElementsByTagName('input'),check=false;
for(var i = 0; i < chckArr.length; i++ )
if(chckArr[i].getAttribute('type')=='checkbox')
check=chckArr[i].checked?true:false;

if(!check)
{
alert('You must click any of the checkbox to proceed to the delete part.');
return false;
}
}
}
</script>
<form id="myform" onsubmit="return ray.validate(this)">
<input type="checkbox">
<input type="checkbox">
<input type="checkbox">
<input type="checkbox">
<input type="submit" value="delete">
</form>
[/code:3u2g87hi]

Click here to read the whole forum topic