Jscript to check checkboxes
<HTML>
<HEAD>
<script>
function chkall()
{
for (var n=0; n < document.forms[0].length; n++)
{
if (document.forms[0].elements[n].type=='checkbox')
{
document.forms[0].elements[n].checked=true;
}
}
return false;
}
</script>
</HEAD>
<BODY>
<form action="chboxes.aspx" onsubmit="return chkall();">
<P><INPUT type=checkbox></P>
<P><INPUT type=checkbox ></P>
<P><INPUT type=checkbox ></P>
<P><INPUT type=checkbox ></P>
<P><INPUT type=submit value=Submit name=submit1></P>
</form>
</BODY>
</HTML>
<HEAD>
<script>
function chkall()
{
for (var n=0; n < document.forms[0].length; n++)
{
if (document.forms[0].elements[n].type=='checkbox')
{
document.forms[0].elements[n].checked=true;
}
}
return false;
}
</script>
</HEAD>
<BODY>
<form action="chboxes.aspx" onsubmit="return chkall();">
<P><INPUT type=checkbox></P>
<P><INPUT type=checkbox ></P>
<P><INPUT type=checkbox ></P>
<P><INPUT type=checkbox ></P>
<P><INPUT type=submit value=Submit name=submit1></P>
</form>
</BODY>
</HTML>
No comments:
Post a Comment