Solved

how to maintain checkbox state across pages

Posted on 2009-05-04
7
659 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

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. …
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
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…
Suggested Courses

623 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