Solved

how to maintain checkbox state across pages

Posted on 2009-05-04
7
653 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
Comment Utility
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
Comment Utility
can you provide any links related to this?
0
 
LVL 10

Expert Comment

by:bugada
Comment Utility
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 Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 10

Accepted Solution

by:
bugada earned 500 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
not proper answer
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

In this article, we'll look how to sort an Array in JavaScript, including the more advanced techniques of sorting a collection of records either ascending or descending on two or more fields. Basic Sorting of Arrays First, let's look at the …
This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
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…

772 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now