MoRiA
12-03-2002, 12:31 PM
I am trying to make a quiz for my site but am having trouble with the radio buttons.
I have 10 questions with 4 multiple choice answers each. How would I check which of the 4 radio buttons is selected and set it's value to a variable?
For the set of 4 radio buttons I have this code:
<input type="radio" value="A1" name="Q1">
<input type="radio" value="A2" name="Q1">
<input type="radio" value="A3" name="Q1">
<input type="radio" value="A4" name="Q1">
Each question has a different name (Q1 through to Q10).
If it is not possible to set it's value as a variable then I would like to simply set 1 or 0 as the variable for that question so I can add it all up later in another script.
Thanks to anyone who can help.
I have 10 questions with 4 multiple choice answers each. How would I check which of the 4 radio buttons is selected and set it's value to a variable?
For the set of 4 radio buttons I have this code:
<input type="radio" value="A1" name="Q1">
<input type="radio" value="A2" name="Q1">
<input type="radio" value="A3" name="Q1">
<input type="radio" value="A4" name="Q1">
Each question has a different name (Q1 through to Q10).
If it is not possible to set it's value as a variable then I would like to simply set 1 or 0 as the variable for that question so I can add it all up later in another script.
Thanks to anyone who can help.