Displaying checked checkbox in same page as well as print on another page ....also add next pages cheches checkbox into previous list

Ads
 

Displaying checked checkbox in same page as well as print on another page ....also add next pages cheches checkbox into previous list

1)checkboxExampl.jsp

<%@page import="java.sql.*"%>
<%try{Connection conn = null;Class.forName("com.mysql.jdbc.Driver").newInstance();conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/test","root", "root");ResultSet rs = null;Statement st=null;st=conn.createStatement();rs = st.executeQuery("select * from employee"); while(rs.next()){ %><%}}catch(SQLException e){ System.out.println(e.getMessage()); } %>
IdNameAddress
><%= rs.getString("empid") %><%= rs.getString("name") %><%= rs.getString("address") %>


Selected Data

2)gettable.jsp

<%@page language="java" import ="java.sql.*" %> <% String val[] = request.getParameterValues("val");String st="";for(int i=0;i"+rs.getString("empid")+""+rs.getString("name")+""+rs.getString("address")+""; } } response.getWriter().println(buffer); %>

Thank you Deepak for your valuable reply...........:-) it really works

But,I want some more help from you.

In my program , i have given to link to different jsp pages. Suppose it contains two links with two different jsp pages.

Both jsp pages contains differents database tables, n it contains same checkboxes.

So, from your above code, i can display selected checkbox on same page. It works...

But when i go to another page link containing same format, it does not display previous page's selected checkboxes.

So, i want such output, which can show previous pages selected checkbox as well as i aslo include next page's selected checkbox in display list on same pages respectively.( i don't know exactly, but can we store it in session and in collection so that we can display all selected checkbox)

Please,please help me... waiting for your reply

View Answers

October 21, 2010 at 11:45 AM

Hey please, help me.. i am new in java and jsp

please, send me modified code

waiting your reply


October 21, 2010 at 1:14 PM

Hi Friend,

Do you want to show only selected checkbox row?

Please clarify this.

Thanks


October 21, 2010 at 3:41 PM

yes.....i want to display selected checkboxs...but in the final display table it should be display in category wise means..from first page , if we select 4 checkbox and from second page ,if we selected 3 checkboxes,then my output should be such that, in table in first column it should give table name and in next column it should give all selected checkbox of that table only(for one page display in one row of display table)

so, 1st row contains two columns,in 1st column,it contains first page's tables name and 2nd column contains all selected checkbox.

Please, please give me code. Help me. waiting 4 your reply.


October 21, 2010 at 4:39 PM

please, send me modified code

waiting your reply


October 22, 2010 at 11:07 AM

please, send me modified code I need help...... waiting your reply

Ads









Related Tutorials/Questions & Answers:
Displaying checked checkbox in same page as well as print on another page ....also add next pages cheches checkbox into previous list
Displaying checked checkbox in same page as well as print on another page ....also add next pages cheches checkbox into previous list  1..., which can show previous pages selected checkbox as well as i aslo include next
to bring checked data from one page to another
to bring checked data from one page to another  thanks for your help... fetching data from the database on second jsp page with checkbox corresponding each... on save button then the two rows data should print on first jsp page without making
Advertisements
JSP - Checkbox remain checked although checked values should depend on values stored in a stateful session bean
) which allows user to go back to the previous page as well. If an item...JSP - Checkbox remain checked although checked values should depend on values... have different items to choose from. And there is another page final.jsp which
checkbox
checkbox  how to insert multiple values in database by using checkbox in jsp
add same tables in jsp page
add same tables in jsp page  hi I have a table in my jsp page with data, now I want to add same copy of table without its default value in same page whenever I click add more table, how do I do
Checkbox
Checkbox       A checkbox is again a label which is displayed as a pushbutton as shown in the example below. This pushbutton can either be checked or unchecked. Therefore, the state
Checkbox method
Checkbox method  what is the method to check if the checkbox is checked
JSP CheckBox
checkbox and also print the userdefined message that specify the languages option... is used to print the selected checkbox in the browser. Here is the code of ... JSP CheckBox     
how to update checkbox list in database
how to update checkbox list in database  Issues: i am using different checkboxs for getting role then all role list store in one string array i want to update one by one but it's not updating by using below code .it's not adding
JavaScript Checkbox getElementById
JavaScript Checkbox getElementById...() for checkbox in JavaScript. In the given example we are going to show an image on clicking the checkbox. This is done by using the JavaScript method getElementById
JSP Checkbox
checked. <%@ page language="java" contentType="text/html; charset...JSP Checkbox In this tutorial you will learn how to create a checkbox using JSP. As we know, checkbox allows multiple selection at a time, but radio
How to add two calendars on the same html page
How to add two calendars on the same html page  I have used the same... on same html page it doesn't work..The first calendar works but the second.... Rest of the code remains same. <html> <head> <title>Java
print selected checkbox names in array without form tag
print selected checkbox names in array without form tag  Hi everyone ... I have problem in my program. I have hashmap i.e. collection , my... seleced checked checkbox names, when i click on button but without using FORM tag
Learn about JSP CheckBox
from multiple checkbox and also print the userdefined message that specify... will be able to know what is JSP checkbox and also how it works in creating a checkbox... is used to print the selected checkbox in the browser. Here is the code
Dropdown Checkbox list
Dropdown Checkbox list This tutorial explains how to create jquery Dropdown Checkbox list in JSP.  This example is created in eclipse IDE and run... jquery Dropdown Checkbox list. The application directory structure should look like
Ajax Checkbox
Ajax Checkbox  I want ajax code for checkboxes.The scenario is that if a selectbox is selected the corresponding values to it in the database table are to be checked in the checkbox.....Please do help me
Dojo Checkbox
Dojo Checkbox          In this section, you will learn how to create a checkbox in dojo. For creating checkbox you require "dijit.form.CheckBox". The checkbox button do
How to change the checkbox value dynamically.
struts 1.2 checkbox tag. Requirement is on page load the value must be "true"(checked). And after loading the page i am uncheking the check box and again loading the page. Then the checkbox is checked instead it have to show unchecked. And even
UIButton checkbox
UIButton checkbox  iPhone UIButton checkbox example required.. can any one please explain me.. how to create a checkbox button using UIButton in XIB
how to use dropdown list in JSP and display value in same page
how to use dropdown list in JSP and display value in same page  I... one option the value must get displayed below it in the same page... in the same page Value selected = C How can we do this in a JSP page
Displaying different portions of a page subsequently on the basis of action
with previous portion on the same page that contains four Radio buttons(Group...Displaying different portions of a page subsequently on the basis...: with js calender beside these and a SEARCH Button(When the page initially loads
code to alert when no checkbox is selected and verify them with orther set
of checkboxes in the same jsp page , the list names are "attendess" and "Absentees... the list Attendees and also alert me when the user checks same name under both...code to alert when no checkbox is selected and verify them with orther set 
Addin checkbox to table
Addin checkbox to table  how to add checkboxes in JTable
checkbox with dropdown listbox in jsp
checkbox with dropdown listbox in jsp  i loaded the the data into the drop down listbox in jsp from access database.now i have to add a check box,if it checked means dropdownlist box carryout the data's,else it should
Flex checkbox control example
Flex checkbox control example       The page provides illustration about the working of flex checkbox control. Example is based on registration for online training courses
pass to next page
just creates another textbox on first page. I am using notepad. Thanks...pass to next page  I am working on a school project no server client side only. 1st page you enter data such as name, address, DoB etc.(textboxes
enable disable checkbox in javascript
enable disable checkbox in javascript  How to enable disable checkbox in javascript
refresh checkbox jframe
refresh checkbox jframe  How to refresh checkbox button in JFrame
Reset checkbox style to default
Reset checkbox style to default  Reset checkbox style to default   input[type="checkbox"] { /* styles
how to add components (like button , checkbox etc) in a table column in core java
how to add components (like button , checkbox etc) in a table column in core java  plz tell me how to add components(like button, checkbox, radiobutton etc)in a table column in core java
static page and dynamic pages?
static page and dynamic pages?  what is the static page and dynamic pages

Ads