Click here to Skip to main content
15,914,016 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am developing online test sample,i want to retrieve the question and answers from the database and display them.Actually its working,my problem is when i select answer for second question,the first is unchecked.what is the problem.
Posted

1 solution

If your input elements are of type radio button, you have probably set the name attribute of all answers to the same name. For the radio button to behave as expected each group (one group per question) of radio buttons needs to have the same name attribute.

Regards,

Manfred
 
Share this answer
 
v2
Comments
DeepthiTanguturi 23-Feb-12 8:08am    
I gave same name to all radio buttons.
Manfred Rudolf Bihy 24-Feb-12 9:56am    
All input elements (radio buttons) for one question should have the same name. That way only one answer can be selected for each question.
Sarvesh Kumar Gupta 24-Feb-12 0:12am    
not same name, give diffrent group name for each question radio buttons.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900