creation of a form


creation of a form

View Answers

October 29, 2009 at 3:22 PM

Hi Friend,

We have taken radiobuttons in our application, you can take textarea, textfield etc.

Create a table ans(ques,op1,op2,op3,op4,op5,ans) in the mysql database and try the following code:


<%@page import="java.sql.*"%>
<form name="form" method="post" action="result.jsp">
Connection conn =DriverManager.getConnection("jdbc:mysql://localhost:3306/register","root","root";;);
Statement st=conn.createStatement();
ResultSet rs=st.executeQuery("select * from answers");
int i=0;
<td><input type="radio" name="radio<%=i%>" value="<%= rs.getString(2) %>"></td><td><%=rs.getString(2)%></td>
<td><input type="radio" name="radio<%=i%>" value="<%= rs.getString(3) %>"></td><td><%=rs.getString(3)%></td>
<td><input type="radio" name="radio<%=i%>" value="<%= rs.getString(4) %>"></td><td><%=rs.getString(4)%></td>
<td><input type="radio" name="radio<%=i%>" value="<%= rs.getString(5) %>"></td><td><%=rs.getString(5)%></td>
<td><input type="radio" name="radio<%=i%>" value="<%= rs.getString(6) %>"></td><td><%=rs.getString(6)%></td>
<td><input type="hidden" name="ans<%=i%>" value="<%= rs.getString(7) %>"></td>

<tr><td><INPUT type="submit" name="submit" value="Submit"></td></tr>

2) result.jsp:

<%@page import="java.sql.*"%>
<%@page import="java.util.*"%>
String id[]= new String[10];
for(int i=0;i<10;i++){
String str[]= new String[10];
for(int j=0;j<10;j++){
boolean isCorrect = Arrays.equals(id,str);
out.println("Your Answers are : " + isCorrect);

For more information,please visit the following link:



Related Tutorials/Questions & Answers:
creation of a form - JSP-Servlet
creation of a form  how to create a question paper using JSP code  Hi Friend, We have taken radiobuttons in our application, you can take textarea, textfield etc. Create a table ans(ques,op1,op2,op3,op4,op5,ans
ZF Simple Form Creation
ZF Simple form creation: In the current tutorial we will study how to create a simple form in Zend Framework. We will use two ways to create  form... that phtml file as a simple html file. So, we can create a form in that file
form   Can I prevent a form from being submitted again
Creation of xml
Creation of xml  Hi, I need to fetch details from my database and to create a xml file containing all those datas...My database datas are in key value pair... AppID Label Value 12345 Applicant name XXXX 12345 Masterno
Creation of methods
Creation of methods  I have a only single class and its having only one method ie., main method only.... i need to develop another method that is to reduce my switching code package; import java.util.Scanner
How to create a form in JSP
of the creation of a form through the HTML code in the JSP page. You can simply use... How to create a form in JSP   ... controls of the form have been generated by the following code of the program
Random Creation of password
Random Creation of password  Dear Sir I have created a form with some details in it.When clicking on the submit button it gives me a password .....Details and the password is saved in the database....The password has
How to: generic array creation
How to: generic array creation  How to: generic array creation
object creation - Subversion
object creation in Java  In how many ways we can create objects in Java
object creation - Java Beginners
object creation  I need object creation in depth(with stack,pc registers).Any one can provide me if possible with video/audio
creation of installer - Java Magazine
creation of installer  plz tell me how can be create installer for any developed application in java?  visit the following url it will helps u
exe file creation - JDBC
exe file creation   hi i have done a project in java swings.project name is format migrator.means db migrator. now my aim is create EXE FILE for my project. pls do consider
creation button using objective c
creation button using objective c  creation button using objective c
XSD Creation. - WebSevices
XSD Creation.  When I try to generate xsd from java object. It is generating XSD file finely. But the problem is it isgenerating XSD file elements in alphabetical order. can u please sujest me how can we do that one. I tried
xml file creation in java
xml file creation in java  how to create xml file in java so that input should not be given from keyboard. and that file should be stored.   Please visit the following links:
Session creation and tracking
Session creation and tracking  1.Implement the information persistence across servlet destroy or servlet container start/stop. Write a servlet such that when it is stopped (either by container shutdown or servlet stop
creation of database - SQL
creation of database  hi, where to and how to execute SQL queries?   Hi nanju mysql>CREATE DATABASE search; mysql> SHOW DATABASES; mysql> USE search mysql>create table Emp (fname VARCHAR(20
bean creation exception
bean creation exception  hi i am getting exception while running simple spring ioc program Exception in thread "main" org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class
xml creation in java
xml creation in java  HI, I need a java program to create an xml file... therez a tutorial in your site to create an xml file at but this isn't creating a file, its just
validte method call upon ActionForm creation.
validte method call upon ActionForm creation.  I want to know if validate method is called when ActionForm object is created?   Hi...() method is called when form is submitted. Thanks
Chatbox creation problem
Chatbox creation problem  i have one chat box in my web site and i assigned fixed position to that div.that is workin in mozill but it is not working in ie . thank you`print ("<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
creation of table using a Java swing
creation of table using a Java swing  how to create a table dynamically in Java swing
forums creation using spring with hibernate?
forums creation using spring with hibernate?  how to write mandatory fields with validations in forms using spring with hibernate? give me detailed example
PDF creation in JAVA - JSP-Servlet
PDF creation in JAVA  HI! Good morning.... I want to create pdf file and i want to write something into pdf file....before creation. Upto creation i have done but how to write data into pdf. File Writer is not working
cache creation in java - Java Beginners
cache creation in java  Hi All, I am planing to create cache in my web application. please send me the some sample code to create cache by using org.apache.oro.utils package. please help me out. Thanks, mln15584
checkbox custom tag creation in jsf
checkbox custom tag creation in jsf  how to create check box custom tags with the following functionality: 1.there must be two checkboxes 2.when the first box is checked it must populate the names of bikes,when the second
creation an dmanipulation of trees - Java Beginners
creation an dmanipulation of trees  Hi guys? pls i want to find out a hind aboout what these terms or phrases means, -To create and manipulate a Binary Search Tree -To use the Java API's Stack in conjunction with other
dynamic creation of multiple drop-down menus
dynamic creation of multiple drop-down menus  can anybody plz help me in coding for dynamic creation of multiple drop-down menus in a webpage using ajax/js/html/css
Creation of MultiThreads
Creation of Multiple Threads       Like creation of a single thread, You can also create more than one thread (multithreads) in a program using class Thread
form validation
form validation  how the form validation is done in jsf form using javaScript
Creation of MultiThreads
Creation of MultiThreads       Like creation of a single thread, You can also create more than one thread (multithreads) in a program using class Thread or implementing interface