Answers
Mar 17, 2008 - 10:21 AM
Ardra,
You've answered your own question - you check the second group the same way you checked the first group.
Using JavaScript (as you did in your example), you simply need to look at the "RadioGroup" associated with the second question.
If "RadioGroup1" is the name of the radio buttons for your first question, "RadioGroup2" could be the name of the radio buttons for your second question making your code look like the following:
(For question #1)
if(!document.form1.RadioGroup1[0].checked && !document.form1.RadioGroup1[1].checked && !document.form1.RadioGroup1[2].checked && !document.form1.RadioGroup1[3].checked)
{
alert("Please select an answer for question 1");
return false;
}
return true;
(For question #2)
if(!document.form1.RadioGroup2[0].checked && !document.form1.RadioGroup2[1].checked && !document.form1.RadioGroup2[2].checked && !document.form1.RadioGroup2[3].checked)
{
alert("Please select an answer for question 2");
return false;
}
return true;
Good luck in the PHP world...if you have any more questions, please feel free to post them!
Take care,
Ric
You've answered your own question - you check the second group the same way you checked the first group.
Using JavaScript (as you did in your example), you simply need to look at the "RadioGroup" associated with the second question.
If "RadioGroup1" is the name of the radio buttons for your first question, "RadioGroup2" could be the name of the radio buttons for your second question making your code look like the following:
(For question #1)
if(!document.form1.RadioGroup1[0].checked && !document.form1.RadioGroup1[1].checked && !document.form1.RadioGroup1[2].checked && !document.form1.RadioGroup1[3].checked)
{
alert("Please select an answer for question 1");
return false;
}
return true;
(For question #2)
if(!document.form1.RadioGroup2[0].checked && !document.form1.RadioGroup2[1].checked && !document.form1.RadioGroup2[2].checked && !document.form1.RadioGroup2[3].checked)
{
alert("Please select an answer for question 2");
return false;
}
return true;
Good luck in the PHP world...if you have any more questions, please feel free to post them!
Take care,
Ric
Mar 23, 2008 - 01:27 AM
Thank you Ric...
Mar 04, 2009 - 06:06 AM
The question looks to be abandoned by the user who asked it. If no action is taken within 2 days, a Quomon Moderator will consider closing the question and distributing the points.
The Quomon Team
The Quomon Team
Add New Comment