Solved

how to maintain checkbox state across pages

Posted on 2009-05-04
7
656 Views
Last Modified: 2013-11-05
i have implemented pagination in jsp.these values will come from DB. checkboxes are there against each record.when user checks 3 records in 1st page and goes to 2nd pages and again comes back to 1st page whatever user checked previously it should be checked.how to maintain this state in javascript ?How to achieve this functionality.i need to maintain the checkbox state across multiple pages?i searched in web and didnt find any proper answers.
0
Comment
Question by:chaitu chaitu
  • 3
  • 3
7 Comments
 
LVL 10

Expert Comment

by:bugada
ID: 24294781
I think you can store your checkbox state in a session cookie instantiated by javascript,
Otherwise you can pass selected checkbox to your backend program a save it in its session.
0
 
LVL 20

Author Comment

by:chaitu chaitu
ID: 24294796
can you provide any links related to this?
0
 
LVL 10

Expert Comment

by:bugada
ID: 24294964
Here a tutorial on how to handle cookie with javascript

http://www.elated.com/articles/javascript-and-cookies/

You can also use a library like HTTP.Cookies on JSAN that simplify the operation.
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 10

Accepted Solution

by:
bugada earned 500 total points
ID: 24294972
ah remember that you can store a limited amount of data on cookies and normally only 20 cookies per domain are alloweb by browsers.
0
 
LVL 12

Expert Comment

by:Gibu George
ID: 24295009
If you are fetching records on page turn, then you can save it in the servers session object,
0
 
LVL 20

Author Comment

by:chaitu chaitu
ID: 24295130
anyhow i need to store the checked id's in session and compare those id's with the database values at client side and only those id's should be checked.

 i will try to write the code and let you know the status once it  is over.

i wonder i searched the web i didnt find proper reference.
0
 
LVL 20

Author Closing Comment

by:chaitu chaitu
ID: 31577521
not proper answer
0

Featured Post

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Else condition 9 23
Writing comments on <p></P> or paragraph 2 19
Load data upon clicking a button 8 35
Start Auto-download of File when page loads? 1 22
This article shows how to create and access 2-dimensional arrays in JavaScript.  It includes a tutorial in case you are just trying to "get your head wrapped around" the concept and we'll also look at some useful tips for more advanced programmers. …
In my daily work (mainly using ASP.net), I need to write a lot of JavaScript code. One of the most repetitive tasks I do are the jQuery Ajax calls. You know: (CODE) I don't know if for you it's the same, but for me is soooo tedious to write the …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question