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



Home Answers Viewqa JSP-Servlet Displaying checked checkbox in same page as well as print on another page ....also add next pages cheches checkbox into previous list
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


rahul
Displaying checked checkbox in same page as well as print on another page ....also add next pages cheches checkbox into previous list
5 Answer(s)      3 years and 11 months ago
Posted in : JSP-Servlet


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


Advertisement
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..., which can show previous pages selected checkbox as well as i aslo include next
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
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
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
,selected checked checkboxes in another table in same jsp page. (for example...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
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
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  how to insert multiple values in database by using checkbox in jsp
Adding checkbox to List as item
Adding checkbox to List as item   can we add checkox to List  ...(); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JList list = new JList(new...(MouseEvent event){ JList list = (JList) event.getSource(); int
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
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
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
Checkbox method
Checkbox method  what is the method to check if the checkbox is checked
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
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
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 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     
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
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
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
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
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..., previous arraylist is replace by new arraylist with same name. Please, can you give
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
Checkbox pagination problem
Selected Domains" table , it is displaying checked checkboxes. But at same time...Checkbox pagination problem  HI ., Following is my code test.jsp <%@page import="java.sql.*"%> <%@taglib prefix="c" uri="/WEB-INF/c
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
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
Display JSP selected listbox and checkbox in xml-please help me
it should show 1st and 2nd page's selected listbox as well as checkbox list from... select something from 2nd list, third page contains checkbox which is taken from... ,it will stored in XML file and at same time ,it should display second page containing
static page and dynamic pages?
static page and dynamic pages?  what is the static page and dynamic pages
Advertisements
 

 

 

DMCA.com