I have a form that has 20 questions and each question has 5 answers (each being a radio button). As the user answers each question by clicking the appropriate radio button, I call a function that scores the answer. The function is below and it works well.
The problem is that now i need to add additioal fields to this form. Some of those new fields are also radio button groups. When I add these, it breaks my function below. I have tried to place the questions that I want to score in a <div> but I can't figure out the code.
Original Function:
The problem is that now i need to add additioal fields to this form. Some of those new fields are also radio button groups. When I add these, it breaks my function below. I have tried to place the questions that I want to score in a <div> but I can't figure out the code.
Original Function:
Code:
Function ScoreMe()
document.GetElementByID("TotScore").value = 0
For each el in document.forms(0).elements
If el.type = "radio" and el.checked = true then
document.GetElementByID("TotScore").value = CInt(document.GetElementByID("TotScore").value) + CInt(el.value)
End If
Next
End Function