I am trying to populate some questionnaires with the following code. Some of the answers will be in text boxes, the others will be using Yes/No Radio Buttons.
The code for the output table of questions is as follows:
Response.Write "<table>"
do until rst.EOF
Response.Write "<tr>"
'Insert the Question Being Asked Response.Write "<th align='left'>" & rst("Question"
& "</th>"
'Choice of answers. DataTypeID = 4 is the yes/no radio buttons
If rst("DataTypeID"
= 4 then
Response.Write "<td>"
Response.Write "<INPUT type='radio' name= 'Answer' CHECKED Value = 'Yes'>" & " Yes "
Response.Write "<INPUT type='radio' name= 'Answer' Value = 'No'>" & " No"
Response.Write "</td>"
Else
'Regular text box answer
Response.Write "<td>" & "<input type='text' name='Answer" & trim(rst("QuestionID"
) & "'>" & "</td>"
End if
Response.Write "</tr>"
rst.MoveNext
loop
. . . etc.
The text box answers work fine.
Right now the Yes/No radio buttons show up, but if I click an answer in one button on a page, the answer disappears from another question. What am I doing wrong?
The code for the output table of questions is as follows:
Response.Write "<table>"
do until rst.EOF
Response.Write "<tr>"
'Insert the Question Being Asked Response.Write "<th align='left'>" & rst("Question"
'Choice of answers. DataTypeID = 4 is the yes/no radio buttons
If rst("DataTypeID"
Response.Write "<td>"
Response.Write "<INPUT type='radio' name= 'Answer' CHECKED Value = 'Yes'>" & " Yes "
Response.Write "<INPUT type='radio' name= 'Answer' Value = 'No'>" & " No"
Response.Write "</td>"
Else
'Regular text box answer
Response.Write "<td>" & "<input type='text' name='Answer" & trim(rst("QuestionID"
End if
Response.Write "</tr>"
rst.MoveNext
loop
. . . etc.
The text box answers work fine.
Right now the Yes/No radio buttons show up, but if I click an answer in one button on a page, the answer disappears from another question. What am I doing wrong?