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

 
 


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)      2 years and 8 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

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 Pages:
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
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
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
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
,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
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
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
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
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 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>:      
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
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
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
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
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
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
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 
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
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
deleting messages using checkbox in JSP
deleting messages using checkbox in JSP  Am working on a Mail Server... it but if during last message left in mail and its already checked;i click...'). am posting my code also..... <html> <head> <script>
deleting messages using checkbox in JSP
deleting messages using checkbox in JSP  Am working on a Mail Server... it but if during last message left in mail and its already checked;i click...'). am posting my code also..... <html> <head> <script>
insert data in the database using checkbox
the database using servlet on the jsp page and there is checkbox corresponding... should i insert only checked data into database on submission.   We... book.jsp <%@page import="java.sql.*"%> <form name=myname method=post
NEXT and PREVIOUS Records - JSP-Servlet
NEXT and PREVIOUS Records  Dear Sir, In my Project i have next and previous buttons at bottom of my page which is working fine.But as per our requirement next,previous buttons should be placed at top of the page as well
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
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
Actin form for checkbox - Struts
Action form for checkbox  What I want to do is very simple, but I'm pretty new at struts and its a little hard for me. I have one page, where..., and multiple boxes can be checked. On the second page, which is the form action
Dojo Tree With Checkbox - Framework
with tree structure. The checkbox will have 3 states: (1) partially checked, (2) checked, and (3) unchecked. It would work the way a feature-selection widget does... structure in a jsp along with checkbox besides each node. The tree structure
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
How to iterate over a checkbox group
would do the same for all of the checkboxes in MASTER that are not checked...How to iterate over a checkbox group  Hi. I am new to using JQuery... checkbox groups. Each of these groups consist of multiple checkboxes. The first
[JSP] How to pass back ID to previous page.
ViewProducts.jsp is displaying list of all products. The previous page from...[JSP] How to pass back ID to previous page.  Hi experts, May I ask something. How to link a page to previous page which the content in previous
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
Checkbox method
Checkbox method  what is the method to check if the checkbox is checked
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
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
store value in checkbox from gridview
store value in checkbox from gridview  Please check the error... <%@ page language="java" import="java.sql.*" %> <% Class.forName...++) { if(document.admin.chbox[i].checked) { count++; } } if(count==0
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
Checkbox blocked - WebSevices
Checkbox blocked  Hi, i design online ticket reservation for bus. It contains no of seats. if i choose 3 or 4 seats checkbox,it will stored in my database. After i refreshing the page that checkbox seats are blocked
Display values in textbox on selecting checkbox
into next five. We have ten text boxes and a checkbox. As the user enters value... in first five textbox, the same values will get displayed in next 5 textboxes...Display values in textbox on selecting checkbox Here we are going to perform
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 selection in jsp
checkbox selection in jsp  hey guys i am working on a web based project using jsp. In my project i am having 9 check boxes in 3 rows in the same form. I want to select i check box from each row and also i want to avoid many
jQuery to Select Multiple CheckBox
the checkbox."; } ?> Step 2: Write HTML page to call the postData.php... jQuery to Select Multiple CheckBox   ... program that retrieves the value of selected checkbox from server and displays
jQuery to Select Multiple CheckBox
the checkbox.";  } ?> Step 2: Write HTML page to call... jQuery to Select Multiple CheckBox   ... program that retrieves the value of selected checkbox from server and displays
checkbox
checkbox  how to insert multiple values in database by using checkbox in jsp
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
Output Previous or Next Day of the Month
Output Previous or Next Day of the Month   Please Help! I need... they want the next day or the previous day. E.g., the user would see: Enter todays... or previous day: The program should output the next day's or previous day's date
how to insert checkbox value into database using jsp
how to insert checkbox value into database using jsp  How to insert... also have the ACTIVITY table, where it have the PK for every activities...; <input type="checkbox" name="pack_meal" id
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