Hi
I need to validate a page with a lot of radiobuttons (dynamicly created bij PHP):
and so on... exactly 10 radiogroups per page. To validate if one of the radiobuttons in each group is selected I wrote this:
But this isn't working... I've looked around on the internet but I can't get a solution to my problem.
Anyone?
T.I.A.
Don't eat yellow snow!
I need to validate a page with a lot of radiobuttons (dynamicly created bij PHP):
Code:
<form name="svl">
<input type="radio" name="question_1" value="3">
<input type="radio" name="question_1" value="2">
<input type="radio" name="question_1" value="1">
<input type="radio" name="question_2" value="3">
<input type="radio" name="question_2" value="2">
<input type="radio" name="question_2" value="1">
<input type="radio" name="question_3" value="3">
<input type="radio" name="question_3" value="2">
<input type="radio" name="question_3" value="1">
...
<input type="button" value="Submit" onClick="return Validate(); document.svl.submit();">
</form>
and so on... exactly 10 radiogroups per page. To validate if one of the radiobuttons in each group is selected I wrote this:
Code:
function Validate()
{
for (i=1;i<11;i++)
{
for (j=0;j<3;j++)
{
if(document.svl.question_'+i'[j].checked == true)
{
return (true);
}
else
{
alert ('Please make a choice in every group');
return (false);
}
}
}
}
But this isn't working... I've looked around on the internet but I can't get a solution to my problem.
Anyone?
T.I.A.
Don't eat yellow snow!