| | |
Radio button name
Please support our JSP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
•
•
Join Date: Jun 2009
Posts: 22
Reputation:
Solved Threads: 1
Hi everyone;
I’ve written the following for some purpose :
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,
I’ve written the following for some purpose :
JSP Syntax (Toggle Plain Text)
<% 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%"> <tr> <td colspan="6"><font size="2"><b><% out.print(n+1); %>)<% out.print(vc.get(n)); %></b></font> </td> </tr> <tr> <td></td> <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> </tr> <% sql = "select option from question where type = 'UStudent' AND question_text = '"+vc.get(n)+"' "; v1=database.jdbcMultipleRowQuery(sql ); out.print(v1.size()); String ses="10/11"; session.setAttribute("ses",ses); 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)+"");%> "> <tr> <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> </tr> <%} } } %> </table> <p align="center" style="text-align: center"> <input type="submit" value="Submit"> </p> </form><p> <% database.jdbcConClose(); 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,
You should get back to basics of HTML. Simple example here
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)
LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
Publilius Syrus
(~100 BC)
LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
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
Simple example
html Syntax (Toggle Plain Text)
<form> <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 </form>
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)
LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
Publilius Syrus
(~100 BC)
LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
![]() |
Similar Threads
- how I chang radio button selection ? (Visual Basic 4 / 5 / 6)
- Deselect the Radio Button (PHP)
- radio button (ASP.NET)
- Want to use radio button or menu bar instead of combo box (Java)
- Am not able to get a radio button selection to display in output (PHP)
- Security Settings -> Java permission -> Custom (radio button) -> Java Custom Settings (Web Browsers)
- Problem passing value from radio button to second page. (PHP)
Other Threads in the JSP Forum
| Thread Tools | Search this Thread |
apache array backbutton combobox comma connection csv database development directorystructure dropdownlist dynamicpagetitles eclipse frames glassfish ie8 imagetodatabse imageupload integer internet java javaee javascript jsf jsp jsppagetitles levels mvc2 mvcmodel2 mysql netbeans network parameters passing ping printinserverinsteadofclient project read redirect request.getparameter response seperated servlet servletdopost()readxml sessions software sql ssl state_saving_method stocks sun tomcat tutorial update values video web write






