Hi everyone;
I’ve written the following for some purpose :

Vector v1,v2;
String sql;
String sqlvsp;

sqlvsp= "select distinct(question_text) from question where type = 'UStudent' ";

 Vector vc=database.jdbcOneRowQuery(sqlvsp);
	for(int n=0;n<vc.size();n++){

<table border="0" width="100%">
<td colspan="6"><font size="2"><b><%	out.print(n+1); %>)<%	out.print(vc.get(n)); %></b></font>

<td align="center" width="16%"><font size="2"><b>Very satisfied</b></font></td>
<td align="center" width="16%"><font size="2"><b>Satisfied</b></font></td>
<td align="center" width="16%"><font size="2"><b>Neither</b></font></td>
<td align="center" width="16%"><font size="2"><b>Dissatisfied</b></font></td>
<td align="center" width="16%"><font size="2"><b>Very dissatisfied</b></font></td>


sql = "select option from question where type = 'UStudent'  AND question_text = '"+vc.get(n)+"' ";

 v1=database.jdbcMultipleRowQuery(sql );
 String ses="10/11";

	for(int i=0;i<v1.size();i++){
	v2 = (Vector)v1.elementAt(i);
for(int j=0;j<v2.size();j++){


<input type="hidden" name="q<%=i%>" value="<%out.print(""+v2.get(0)+"");%> ">

<td align="left"><font size="2"><b><%out.print(""+v2.get(j)+"");%>
<td align="center"><font size="2"><b><input name="<%=i%>" value="Very satisfied" type="radio">1.</b></font></td> 
<td align="center"><font size="2"><b><input name="<%=i%>" value="Satisfied" type="radio">2.</b></font></td> 
<td align="center"><font size="2"><b><input name="<%=i%>" value="Neither" type="radio">3.</b></font></td> 
<td align="center"><font size="2"><b><input name="<%=i%>" value="Dissatisfied" type="radio">4.</b></font></td> 
<td align="center"><font size="2"><b><input name="<%=i%>" value="Very dissatisfied" type="radio">5.</b></font></td> 
<%} }
				<p align="center" style="text-align: center">
	<input type="submit" value="Submit">				




database = null;

When I select the options for the first question , it goes smoothly , but when I want to select the options for the second one it would uncheck the options for the first question, and if I select the options for third question , it would uncheck the options for second question, and ….
Is there way that allow me to select the options for each question and it does not effect the others

My regards,

7 Years
Discussion Span
Last Post by peter_budo

the radio buttons are inside three loops , can anyone take a look on the code and give suggestion ?


The radio buttons that select/deselect have to by member of same group that is declared through name. As you are giving each radio current value of "i" they cannot be grouped.
Simple example

    <input type="radio" name="moderator" value="~s.o.s~" checked="checked"/>~s.o.s~<br />
    <input type="radio" name="moderator" value="peter_budo"  />peter_budo<br/>
    <input type="radio" name="moderator" value="Ezzaral" />Ezzaral<br />
    <input type="radio" name="administrator" value="cscgal"/>cscgal<br />
    <input type="radio" name="administrator" value="happygeek" checked="checked"/>happygeek
This question has already been answered. Start a new discussion instead.
Take the time to help us to help you. Please be thoughtful and detailed and be sure to adhere to our posting rules.