Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa JSP-Servlet creating a feedback form

Have Programming Question? Ask it here!
 
 
 


nishi
creating a feedback form
1 Answer(s)      4 years and 11 months ago
Posted in : JSP-Servlet



Advertisement
View Answers

September 18, 2009 at 2:24 PM


Hi Friend,

Try the following code:

1)radioForm.jsp:

<%@page import="java.util.*"%>
<html>
<form method="post" action="feedback.jsp">
<table>
<%
int i=0;
ArrayList list=new ArrayList();
list.add("How would you rate course to your friends?");
list.add("How much help was textbook? ");
list.add("Interesting?");
list.add("Course material sufficient?");
list.add("Challenging?");
Iterator itr;

for(itr=list.iterator(); itr.hasNext();){
String ans=itr.next().toString();

%>
<tr><td><%=ans%></td><td><input type="hidden" name="question<%=i%>" value="<%=ans%>" ></td>
<td><input type="hidden" name="quid<%=i%>" value="<%=i%>"></td><td><input type="radio" value="Poor" name="radio<%=i%>"/>Poor</td><td><input type="radio" value="Average" name="radio<%=i%>"/>Average</td><td><input type="radio" value="Good" name="radio<%=i%>"/>Good</td></tr>
<% i++;
}
%>
<tr><td><input type="Submit" value="Submit"></td></tr>
</table>
</form>
</html>

2)feedback.jsp:

<%@page import="java.sql.*"%>
<%
String id[]= new String[5];
for(int i=0;i<5;i++){
id[i]=request.getParameter("qid"+i);
System.out.println(id[i]);
}
String option[]= new String[5];
for(int i=0;i<5;i++){
option[i]=request.getParameter("radio"+i);
System.out.println(option[i]);
}
String ques[]= new String[5];
for(int i=0;i<5;i++){
ques[i]=request.getParameter("question"+i);
System.out.println(ques[i]);
}
try{
Class.forName("com.mysql.jdbc.Driver");
Connection conn =DriverManager.getConnection("jdbc:mysql://localhost:3306/register","root","root";);
Statement st=conn.createStatement();
for(int j=0;j<5;j++){
String optionValue=option[j];
String qid=id[j];
String question=ques[j];
st.executeUpdate("insert into question(question,options) values('"+question+"','"+optionValue+"')");
}

out.println("Inserted Successfully");
}
catch(Exception e){
out.println(e);
}
%>

Thanks


Related Tutorials/Questions & Answers:
creating a feedback form - JSP-Servlet
i am refining this problem as follows: i am creating a feedback form of a college. this feedback form will ask some question. now depending upon those...creating a feedback form  hi, first of all thank you very much
to creating a registration form
to creating a registration form  how to create a registration form
Advertisements
Dynamically creating a form in gwt?
Dynamically creating a form in gwt?  how can i create a gwt form by retrieving fields dynamically from a map? i have all the fields set in the data... fields in a map and creating a form with them
creating web page for form registration
creating web page for form registration  I am creating web page for form registration to my department ..I have to Reprint the Application Form (i.e Download the PDf File from the Database ) , when the user gives the Application
Need some help creating an order form.
Need some help creating an order form.  Hi there. I am looking to create an order form for clients to customize the way a product looks. The codes I found on the form html page are useful. My question is: can I tie them all
feedback of o/p - Java Beginners
feedback of o/p  Java feedback program  Hi,In the code:ssint data=100;ssint is a data type class.But in java "ssint" is not a data type.From where you have take the code?I am not able to find it on the net
put image on form creating in swing-swing code - Swing AWT
put image on form creating in swing-swing code  i want to display image on swing panel and get the image co ordinate by mouse clicking.and also zoom the image at particular area of image. please give solution on my email id
Creating Canvas Form Example
Creating Canvas Form Example       This example shows that how to use the Canvas Class in a Form. In this example we take two field in which integer number passed from the form
form
form   Can I prevent a form from being submitted again
How to handle a form in JSP
JSP code which used the HTML code for creating a form and this form is handled... How to handle a form in JSP       This section teaches you about the creating a from
Creating Views
Creating Views Struts provides their own JSP tag library for creating view...; <s:form action="loginSuccess"> <s:textfield name="...; The action is the action in the form tag is the struts action. The form sends
Creating Volume Bar Using Gauge Class
Creating Volume Bar Using Gauge Class       This example is all about creating a volume bar using Gauge class. We are creating the object of Gauge class that contains
Creating Exception
Creating Exception  class Myexception extends Exception{ private int detail; Myexecption(int a){ detail=a; } public String toString(){ return "Myexception["+detail+"]"; } } class Exceptiondemo{ static void Compute(int a) throws
Creating a Frame
, calender, combobox checkbox and many more for creating GUI in Java based... with your applet. Swing libraries is used for creating desktop applications...; Creating a Frame     
struts form
struts form  Hi, This is Rajesh.I'm creating struts form in jsp.i have two textboxes in my jsp.During Jsp page loading focus will automatically should come to second textbox(That means during page loading cursor automatically
Creating a memory leak with Java
Creating a memory leak with Java  Creating a memory leak with Java
form validation
form validation  how the form validation is done in jsf form using javaScript
How to create form in Swings
How to create form in Swings  How to create registration, login and question form in Java Swing?   Creating different forms in Java Swing - Examples how to create registration form in swing swing login form example
creating windo chat
creating windo chat   hi ... please could you help me in creating chat aprograme in java ???? with comments beside codes please
Creating circle inside a circle
Creating circle inside a circle  hi can any one give code for following output by awt/swing creating circle inside a circle ,outside cirlce and intersect a circle
Creating PDF in JAVA
Creating PDF in JAVA  How create pdf in java ? Take value from database for particular PDF
print a form of *
print a form of *   * *** ***** ******* ********* ******* ***** *** *   Post the format properly
creating inheritance of cars
creating inheritance of cars   hi ... please help me in creating inheritance between some types of cars like car that is parent and both of private car and public car are extends it then bus and truck extends public car
creating JD ialog
creating JD ialog   hi ... please help me in creatin a JDialog box that contains two buttons of minimization and exit
Creating a setup file
Creating a setup file  How to create a setup file in tomcat as done in visual studio... could plz tell me as early as possible
creating reports in java
creating reports in java  how to create reports automatically in java and send it via mail by scheduling tine for weekly,monthly basis
Multipage form
Multipage form  I have a multipage form in php with 2 pages wnhen i submit the form data from both the pages should go in database how should i pass teh data from 1st page to 2nd page and then put the entire form data in mysql
jsp form
jsp form  hi sir, one got one got in jsp form after entering the data into the form the data is not saving in the database i will send you code of two forms if dnt understand my problem
submit a form
submit a form  How can we submit a form without a submit button
creating trafficsignal using thread
creating trafficsignal using thread  please give me code how to create trafic signal using thread and give me it to my email jvp_9040@ymail.com thanks
Creating XMl file - XML
Creating XMl file   I went on this page: http://www.roseindia.net/xml/dom/createblankdomdocument.shtml and it shows me how to create an XML file, however there is something I don't understand. I have to create an XML file
creating dropdown lists in jsp
creating dropdown lists in jsp  i want to create two dropdown list which are dependent that is the first box choice have to evaluate the second boxs options
Creating Dynamic Tree
Creating Dynamic Tree   Creating Dynamic Tree: I have to build a tree structure with the following data lets say that with this data childId parentId 1 - 0 (lets say this is root) 2 - 1 3 - 1 4 - 3 5 - 3 6 - 5 7 - 6 all I need
creating java classes
creating java classes  Create a Java class that can be used to store inventory information about a book. Your class should store the book title... a program that tests your class by creating and using at least two objects of the class
creating JAR - Java Beginners
creating JAR  I am beginner in J2ee.I am creating an application in Eclipse.I have created a javaproject and web project in the eclipse.I have installed SQL and Tomcat.I created a JAR of my java project and included
Form handling
Form handling  I created a spring project. I created a jsp...;form:form name="loginForm" modelAttribute="loginForm" method="get"> <...;/td> <td> <form:input path="username"/>
Form Validation
Form Validation  Java script validation for checking special characters and white spaces and give an alert.Please help me urgent Thanks in advance
<form id=
form id  sir, <form id="reg1" action="../UploadingCtrl" method="post" enctype="multipart/form-data" name="form1"> this action page can't get String tp = request.getParameter("indegrates"). i wrote article upload
<form id=
form id  sir, <form id="reg1" action="../UploadingCtrl" method="post" enctype="multipart/form-data" name="form1"> this action page can't get String tp = request.getParameter("indegrates"). i wrote article upload
Creating an executable jar file
Creating an executable jar file  When I try to create jar.exe through CMD, the manifest file created doesn't contain Main-Class attribute, even though it is included in text file used during creation of jar file
creating a global variable with php
creating a global variable with php  Is it possible to create a variable to declare as global in case of database connectivity?   Yes, if you want to have access of that variable anywhere in the program. See the example
creating pop up menu
creating pop up menu   how to create a pop up menu when a link in html page is clicked using jquery? and the link should be a text file   Please visit the following links: http://www.roseindia.net/tutorial/jquery
creating hyperlinks in applet - Applet
creating hyperlinks in applet  Dear sir, how can i move from one applet to another applet and how can i use previous applet input data in anotherapplet(just like session tracking) thanks
Creating tables - IDE Questions
Creating tables  can i get a code that displays 10 records per page from a table student and when i click on the next button it displays the next 10 pages and so on, i'm using vb.net and sql database
Creating a File in the directory.
Creating a file using HTML form action In this example, you will learn to make... of PHP code in the form. for creating a file in PHP, first declare a file name...;; }?> Creating an action form in HTML <!DOCTYPE HTML PUBLIC "
PHP form
PHP form  Hi Sir/Madam, I am developing an attendance form using php, which displays the name and ID of a Employees which are fetched from Db and I... form and update them to respective coloumn... Please any one help mo out please
Form validation
Form validation  Hi Everyone Can someone assist me with a complete code to validate a form. e.g where the user must insert an ID number it should check if the user entered the correct data and within a valid range. This must
creating instance of table in jsp
creating instance of table in jsp  i face senario look kie as follows...;/head> <body> <br><br> <form method="post" name="form">...;%@page import="java.sql.*"%> <form method="post" action="update.jsp">
Creating Database - SQL
Creating Database  Hi I am Guru I am having the confusion in creating the database.Actually Just I joined one small company. I am... ciao.co.uk. we are creating the database in mysql. 1> category->subcategory->
Creating URL in java
Creating URL in java  Hii to all I m trying to create a url using java. Address is http://www.merchant.com/pg/index.html When i m going to run...[] args) { try { // // Creating
Advertisements
 

 

 

DMCA.com