Home Answers Viewqa JSP-Servlet creating a feedback form

 
 


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

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 Pages:
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
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
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
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
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 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 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 "
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
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 methods in servlets - JSP-Servlet
Creating methods in servlets  I created servlet and jsp file.I Instantiated 3 objects and Defined 2 methods in my servlet, first method should write... mistake and check it : 1.In the JSP page having a "Form" Tag You have
Right Way of Creating an Article Outline
Right Way of Creating an Article Outline   ... should firstly begin with the method of creating an article outline... such as creating introduction, writing the article body or concluding the article
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 list in dropdown using struts - Struts
creating list in dropdown using struts   creating list in dropdown using struts : In action class list.add(new LabelValueBean("ID","Name")); In Jsp * Select Item Select In Form : getter
form
form   Can I prevent a form from being submitted again
Form Processing Problem
Form Processing Problem  I am trying to create a Circular Page... to Null and //as well as the passed data from mulitpart/form-data is greater...; (contentType.indexOf("multipart/form-data") >= 0)) { DataInputStream
need help to remove and optimise the code for creating a page
need help to remove and optimise the code for creating a page   i have the following code but it has some sorts of error whenever i run the page... is like this <form action="sfkcreateaccount" method="post">
PHP Form, PHP guest form
PHP email form HTML form It's not a good idea to leave your private e.... But nevertheless you need some way to get feedback from your visitors. In the three parts...=center><br> <form action="index.php"><br> Message:<
Simple Form in Java
Simple Form in Java      ... a form by using various java component. In this section, you will learn how... classes have been used in the program for creating specific component like text boxes
Struts 2.1.8 Login Form
Struts 2.1.8 Login Form       In this section we will learn how we can create form based application in Struts 2.8.1. The Struts 2 framework provides tags for creating the UI forms
web page for form registration to my department
web page for form registration to my department  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
Creating URL using <c:url>
Creating URL using <c:url>     ... the session firstly it is important to get a session object either by creating...; <form action="JSTLCreatingURL.jsp" method="post"> <table>
Creating Login Page In JSF using NetBeans
Creating Login Page In JSF using NetBeans  ... illustrates you how to create a login form in JSF using NetBeans. To create the jsp page...:form> tag creates html form. <h:panelGrid> tag creates html table
How to create a form in JSP
;title>Creating Form in JSP.</title></head> <body> <... 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
ZF Simple Form Creation
to create a form is with Zend Framework. So, let's start by creating... will be created inside the forms directory, if you are creating the form...ZF Simple form creation: In the current tutorial we will study how to create
creating new file with File class - JSP-Interview Questions
creating new file with File class   I have a file uploading concept in my project. For that, while creating a new file is it necessary to give...("multipart/form-data") >= 0)) { DataInputStream in = new DataInputStream
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
insertin form data into databse and blank all form field when click on submit button
insertin form data into databse and blank all form field when click on submit button  sir, i useing the jsp. i want insert form data into Ms-Access database when click on submit button and blank all form field after inserting
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     
Creating a Database in MySQL
Creating a Database in MySQL     ... in the form of tables. So, we can view and use the same database in many different ways... code is used for creating a new database. It takes a database name
Creating Custom Validators in STRUTS
Creating Custom Validators in STRUTS      ... know create a new validator for entering the name field of a form. The form...;javascript><![CDATA[   function validateName(form) {   var
Creating a Database Table
Creating a Database Table     ...) is a type of DBMS (Database Management System) which stores the data in the form... are going to establish the connection with database and creating a table
creating windo chat
creating windo chat   hi ... please could you help me in creating chat aprograme in java ???? with comments beside codes please
form validation
form validation  how the form validation is done in jsf form using javaScript
Display Logo on login form using swing
Display Logo on login form using swing In this tutorial, you will learn how to display a logo in login form using swing components. Here is an example where... username and password from user and check the validity of the user. For creating
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
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 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
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 JD ialog
creating JD ialog   hi ... please help me in creatin a JDialog box that contains two buttons of minimization and exit
print a form of *
print a form of *   * *** ***** ******* ********* ******* ***** *** *   Post the format properly
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 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 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
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

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.