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)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









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... as well as i aslo include next page's selected checkbox in display list on same
Displaying the entire row in another datatable when the checkbox is checked - Java Server Faces Questions
Displaying the entire row in another datatable when the checkbox... to fetch a row completely when the check box corresponding to that row is checked... the entire row in another datatable.Please tell me the sample code. Thanks
Advertisements
Maintain checked checkbox status
display that "selected checked checkboxes" in same page but in another table. and at same time, after "Refreshing " that page or after coming to that page...Maintain checked checkbox status  Hi everyone In my JSP
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
display checked ckeckbox in same jsp page
_TO_REPLACE_2 Now i want to display ,selected checked checkboxes in another table in same...display checked ckeckbox in same jsp page  how to display checked ckeckbox in same jsp page?   Hi, Here is the html code to display check
PHP Previous Next Page - PHP
PHP Previous Next Page  PHP Previous Next PageIs it possible to create dynamic navigation using PHP and MYSQL? DO I need to create a class to create the next, previous buttons in PHP? I?m digging for a small as well as handy code
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
Help to maintain state of checkbox
the state of checkboxes across pages. What happens is when i check one checkbox and then go to say 2nd page then check one checkbox there and when i return to previous page the checked box is again unchecked. Means the status of the checkbox
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
Adding checkbox to List as item
Adding checkbox to List as item   can we add checkox to List  ...)); } }); frame.getContentPane().add(new JScrollPane(list)); frame.pack...(); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JList list = new
Checkbox method
Checkbox method  what is the method to check if the checkbox is checked
Displaying facemessage to a another page - Java Server Faces Questions
Displaying facemessage to a another page  Dear All, I have requirement to display FaceMessage to an another page that is other than the requested page. Code in the backing bean is some thing like
Jsp-delete checked checkboxes and display UNCHECKED checkboxes in table as well as in store that unchecked checkboxes in ARRAYLIST
Jsp-delete checked checkboxes and display UNCHECKED checkboxes in table as well... clicked on DELETE button, it should delete records of checked checkbox rows. I... with about 20rows, which contain a checkbox and a bit of text each. What I'm
Problem to display checkbox item
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... checkbox on same page. It works... But when i go to another page link containing same
JSP CheckBox
checkbox and also print the userdefined message that specify the languages option... the out.println is used to print the selected checkbox in the browser. Here... JSP CheckBox     
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
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
CheckBox in Flex4
CheckBox both are same thing. Checkbox contains two part in a graphical shape... .The default value of Checkbox is unchecked. Checkbox value is true when it is checked...CheckBox in Flex4: In Flex 4 the CheckBox Control is comprises from
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
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... the out.print ln is used to print the selected checkbox in the browser. Here
Checkbox pagination problem
checked checkboxes. But at same time , whatever the displaying in "Total selected...Checkbox pagination problem  HI ., Following is my code test.jsp <%@page import="java.sql.*"%> <%@taglib prefix="c" uri="/WEB-INF/c
checkbox custom tag creation in jsf
is checked names of cars must be populated in the same list 3.when both are checked names of bikes as well as cars must be populated in the same list...checkbox custom tag creation in jsf  how to create check box custom
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
Display JSP selected listbox and checkbox in xml-please help me
as well as checkbox list from database. and in final page it should display all... jsp. When user select something from 2nd list, third page contains checkbox... first page ,it will stored in XML file and at same time ,it should display second
static page and dynamic pages?
static page and dynamic pages?  what is the diff between static page and dynamic pages
static page and dynamic pages?
static page and dynamic pages?  what is the static page and dynamic pages
static page and dynamic pages?
static page and dynamic pages?  what is the static page and dynamic pages adv and disadv
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
Problem with DOJO tree with checkbox - Framework
. But at the same time I'm facing following issues. 1. Partially checked & checked... DOMNode at creation-time for tree, add checkbox to it function addCheckBox(message) { // add checkBox before titleNode var node = message.source
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
How to check a checkbox - Struts
setting the checked attribute of a checkbox to true/checked when using the tags. By the way, is there another way of setting the checking a checkbox other than...How to check a checkbox  Hello Community, How can i check a checkbox
How to display content in same page while selecting fron dropdown list
How to display content in same page while selecting fron dropdown list ... dropdownlist in jsp page.If i select any value in that list(for eg-rollno),then it want to display all records from table specific to that rollno in that same
How to display content in same page while selecting fron dropdown list
How to display content in same page while selecting fron dropdown list  Thanks for your suggesstion.but Please provide me coding by using only one dropdownlist in javascript or jquery.Thanks in advance
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
Servlets errors in same page.
Servlets errors in same page.  How do I display errors list in the same page where a form field exists using servlets...........i.e. without using JSP? Please explain with a simple username password program
Dojo Checkbox
="checked" value="on" type="checkbox" />...Dojo Checkbox          In this section, you will learn how to create a checkbox in dojo
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
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
Checkbox Tag <html:checkbox>:
. value The value to be transmitted if this checkbox is checked... displays the following page. Don't select  checkbox...Checkbox Tag <html:checkbox>:      
populating a screen on the same page
populating a screen on the same page  i'm making a time table in jsp... to a new page which will help them to choose the subject and faculty through drop... to select the subject and faculty....so that we dont need to redirect to other page
Posting comments to same page with textarea
to the same page. Many thanks for that. However I wanted it to add other comments as well rather than overwriting the original?. I hope it is not to much...Posting comments to same page with textarea  I have been given some
Addin checkbox to table
Addin checkbox to table  how to add checkboxes in JTable
display all the values on next page
values are inserting in the database and i am moving on another page after doing some functionality on next page i am returning on my first page and i want...display all the values on next page  i am inserting values
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
Uploading a software and displaying it on the jsp page
Uploading a software and displaying it on the jsp page  I have a Downloads page in my website, I want it to display the name of softwares as soon as it is uploaded in the backend by the administrator. And the admin may be a non

Ads