In article <bkt2hd$ind$1 (AT) blue (DOT) rahul.net>, jeep (AT) 55 (DOT) usenet.us.com
enlightened us with...
Quote:
Im totally new to javascript. Im working on a webpage that I need to
make sure the user has checked at least one answer to each question
in the list. I cant seem to figure out the logic or something. |
Tested successfully in IE.
<script type="text/javascript" language="javascript">
function check_form(f)
{
var forgot;
for (var i=1; i<18; i++)
{
forgot=true;
var l=f.elements["PCLM"+i].length;
for (j=0; j<l; j++)
{
if (f.elements["PCLM"+i][j].checked==true) forgot=false;
}
if (forgot)
{
alert("You forgot one. Number: "+i);
return false;
}
}
return true;
}
</script>
-------------------------------------------------
~kaeli~
All I ask for is the chance to prove that money
cannot make me happy.
http://www.ipwebdesign.net/wildAtHeart http://www.ipwebdesign.net/kaelisSpace
-------------------------------------------------