creating a feedback form

creating a feedback form

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
ModuleNotFoundError: No module named 'django-feedback-form'
ModuleNotFoundError: No module named 'django-feedback-form'  Hi...: No module named 'django-feedback-form' How to remove the ModuleNotFoundError: No module named 'django-feedback-form' error? Thanks   Hi
Advertisements
ModuleNotFoundError: No module named 'django-simple-feedback-form'
ModuleNotFoundError: No module named 'django-simple-feedback-form'  ...: No module named 'django-simple-feedback-form' How to remove the ModuleNotFoundError: No module named 'django-simple-feedback-form' error? Thanks
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
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
ModuleNotFoundError: No module named 'feedback'
ModuleNotFoundError: No module named 'feedback'  Hi, My Python... 'feedback' How to remove the ModuleNotFoundError: No module named 'feedback... to install padas library. You can install feedback python with following
ModuleNotFoundError: No module named 'drf-feedback'
ModuleNotFoundError: No module named 'drf-feedback'  Hi, My Python... 'drf-feedback' How to remove the ModuleNotFoundError: No module named 'drf-feedback' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'polecat-feedback'
ModuleNotFoundError: No module named 'polecat-feedback'  Hi, My... named 'polecat-feedback' How to remove the ModuleNotFoundError: No module named 'polecat-feedback' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'repobee-feedback'
ModuleNotFoundError: No module named 'repobee-feedback'  Hi, My... named 'repobee-feedback' How to remove the ModuleNotFoundError: No module named 'repobee-feedback' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'signbank-feedback'
ModuleNotFoundError: No module named 'signbank-feedback'  Hi, My... named 'signbank-feedback' How to remove the ModuleNotFoundError: No module named 'signbank-feedback' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'stem-feedback'
ModuleNotFoundError: No module named 'stem-feedback'  Hi, My... 'stem-feedback' How to remove the ModuleNotFoundError: No module named 'stem-feedback' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'chroma-feedback'
ModuleNotFoundError: No module named 'chroma-feedback'  Hi, My... named 'chroma-feedback' How to remove the ModuleNotFoundError: No module named 'chroma-feedback' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'cmsplugin-feedback'
ModuleNotFoundError: No module named 'cmsplugin-feedback'  Hi, My... named 'cmsplugin-feedback' How to remove the ModuleNotFoundError: No module named 'cmsplugin-feedback' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'django-feedback'
ModuleNotFoundError: No module named 'django-feedback'  Hi, My... named 'django-feedback' How to remove the ModuleNotFoundError: No module named 'django-feedback' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'drf-feedback'
ModuleNotFoundError: No module named 'drf-feedback'  Hi, My Python... 'drf-feedback' How to remove the ModuleNotFoundError: No module named 'drf-feedback' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'feedback-tool'
ModuleNotFoundError: No module named 'feedback-tool'  Hi, My... 'feedback-tool' How to remove the ModuleNotFoundError: No module named 'feedback-tool' error? Thanks   Hi, In your python
form
form   Can I prevent a form from being submitted again
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
ModuleNotFoundError: No module named 'Anonymous-Feedback-LTI'
ModuleNotFoundError: No module named 'Anonymous-Feedback-LTI'  Hi...: No module named 'Anonymous-Feedback-LTI' How to remove the ModuleNotFoundError: No module named 'Anonymous-Feedback-LTI' error? Thanks   Hi
ModuleNotFoundError: No module named 'azure-cli-feedback'
ModuleNotFoundError: No module named 'azure-cli-feedback'  Hi, My... named 'azure-cli-feedback' How to remove the ModuleNotFoundError: No module named 'azure-cli-feedback' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'django-basic-feedback'
ModuleNotFoundError: No module named 'django-basic-feedback'  Hi...: No module named 'django-basic-feedback' How to remove the ModuleNotFoundError: No module named 'django-basic-feedback' error? Thanks   Hi
ModuleNotFoundError: No module named 'django-basic-feedback'
ModuleNotFoundError: No module named 'django-basic-feedback'  Hi...: No module named 'django-basic-feedback' How to remove the ModuleNotFoundError: No module named 'django-basic-feedback' error? Thanks   Hi
ModuleNotFoundError: No module named 'django-dsm-feedback'
ModuleNotFoundError: No module named 'django-dsm-feedback'  Hi, My... named 'django-dsm-feedback' How to remove the ModuleNotFoundError: No module named 'django-dsm-feedback' error? Thanks   Hi
ModuleNotFoundError: No module named 'django-typeform-feedback'
ModuleNotFoundError: No module named 'django-typeform-feedback'  Hi...: No module named 'django-typeform-feedback' How to remove the ModuleNotFoundError: No module named 'django-typeform-feedback' error? Thanks  
ModuleNotFoundError: No module named 'django-wechat-feedback'
ModuleNotFoundError: No module named 'django-wechat-feedback'  Hi...: No module named 'django-wechat-feedback' How to remove the ModuleNotFoundError: No module named 'django-wechat-feedback' error? Thanks   Hi
ModuleNotFoundError: No module named 'django-wechat-feedback'
ModuleNotFoundError: No module named 'django-wechat-feedback'  Hi...: No module named 'django-wechat-feedback' How to remove the ModuleNotFoundError: No module named 'django-wechat-feedback' error? Thanks   Hi
ModuleNotFoundError: No module named 'opal-azure-cli-feedback'
ModuleNotFoundError: No module named 'opal-azure-cli-feedback'  Hi...: No module named 'opal-azure-cli-feedback' How to remove the ModuleNotFoundError: No module named 'opal-azure-cli-feedback' error? Thanks   
ModuleNotFoundError: No module named 'redsolutioncms.django-simple-feedback'
ModuleNotFoundError: No module named 'redsolutioncms.django-simple-feedback...: ModuleNotFoundError: No module named 'redsolutioncms.django-simple-feedback' How...-feedback' error? Thanks   Hi, In your python environment you
ModuleNotFoundError: No module named 'Anonymous-Feedback-LTI'
ModuleNotFoundError: No module named 'Anonymous-Feedback-LTI'  Hi...: No module named 'Anonymous-Feedback-LTI' How to remove the ModuleNotFoundError: No module named 'Anonymous-Feedback-LTI' error? Thanks   Hi
ModuleNotFoundError: No module named 'azure-cli-feedback'
ModuleNotFoundError: No module named 'azure-cli-feedback'  Hi, My... named 'azure-cli-feedback' How to remove the ModuleNotFoundError: No module named 'azure-cli-feedback' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'django-ajax-feedback'
ModuleNotFoundError: No module named 'django-ajax-feedback'  Hi...: No module named 'django-ajax-feedback' How to remove the ModuleNotFoundError: No module named 'django-ajax-feedback' error? Thanks   Hi
ModuleNotFoundError: No module named 'django-basic-feedback'
ModuleNotFoundError: No module named 'django-basic-feedback'  Hi...: No module named 'django-basic-feedback' How to remove the ModuleNotFoundError: No module named 'django-basic-feedback' error? Thanks   Hi
ModuleNotFoundError: No module named 'django-dsm-feedback'
ModuleNotFoundError: No module named 'django-dsm-feedback'  Hi, My... named 'django-dsm-feedback' How to remove the ModuleNotFoundError: No module named 'django-dsm-feedback' error? Thanks   Hi
ModuleNotFoundError: No module named 'django-feedback-api'
ModuleNotFoundError: No module named 'django-feedback-api'  Hi, My... named 'django-feedback-api' How to remove the ModuleNotFoundError: No module named 'django-feedback-api' error? Thanks   Hi
ModuleNotFoundError: No module named 'django-object-feedback'
ModuleNotFoundError: No module named 'django-object-feedback'  Hi...: No module named 'django-object-feedback' How to remove the ModuleNotFoundError: No module named 'django-object-feedback' error? Thanks   Hi
ModuleNotFoundError: No module named 'django-simple-feedback'
ModuleNotFoundError: No module named 'django-simple-feedback'  Hi...: No module named 'django-simple-feedback' How to remove the ModuleNotFoundError: No module named 'django-simple-feedback' error? Thanks   Hi
ModuleNotFoundError: No module named 'django-simple-feedback-collector'
ModuleNotFoundError: No module named 'django-simple-feedback-collector' ...: ModuleNotFoundError: No module named 'django-simple-feedback-collector' How to remove the ModuleNotFoundError: No module named 'django-simple-feedback-collector'
ModuleNotFoundError: No module named 'django-typeform-feedback'
ModuleNotFoundError: No module named 'django-typeform-feedback'  Hi...: No module named 'django-typeform-feedback' How to remove the ModuleNotFoundError: No module named 'django-typeform-feedback' error? Thanks  
ModuleNotFoundError: No module named 'django-wechat-feedback'
ModuleNotFoundError: No module named 'django-wechat-feedback'  Hi...: No module named 'django-wechat-feedback' How to remove the ModuleNotFoundError: No module named 'django-wechat-feedback' error? Thanks   Hi
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
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 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 an Applet
Creating an Applet  Hi, I have get a task regarding Creating an Applet using all Layout Manager, can anyone help me in this regard. I donā??t know how to make and please help me. Thanks.   To answer of your query
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
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 a memory leak with Java
Creating a memory leak with Java  Creating a memory leak with Java

Ads