HI guys ,
i'm new to this community. plz help :'(
i'm doing a project which is called Online Examination..
can i give a variable as value in radio button????
Here is my code
<%
try{
int num;
double d=Math.random()*10;
PrintWriter oo=response.getWriter();
num=(int)d;
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:mno");
Statement stmt=con.createStatement();
ResultSet rs=stmt.executeQuery("select * from test where Q_NO="+num+"");
while(rs.next()){
out.println("Question_No : "+rs.getInt(1));
out.println("<br>");
out.println("Question : "+rs.getString(2));
out.println("<br>");
out.println("<br>");
out.println("<input type='radio' name='n1' value="+rs.getString(3)+"/>")
/*when i give value as code above in radio button, the below code is not
displaying*/
out.println(rs.getString(3));
out.println("<br>");
out.println("<input type='radio' name='n1'>");
out.println(rs.getString(4));
out.println("<br>");
out.println("<input type='radio' name='n1'>");
out.println(rs.getString(5));
out.println("<br>");
out.println("<input type='radio' name='n1'>");
out.println(rs.getString(6));
out.println("<br>");
String a=rs.getString(3);
}
}catch(Exception e){}
%>
Help me PLZ.......
Thanks in advance...
Manoj