• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 667
  • Last Modified:

how to maintain checkbox state across pages

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
chaitu chaitu
Asked:
chaitu chaitu
  • 3
  • 3
1 Solution
 
bugadaCommented:
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
 
chaitu chaituAuthor Commented:
can you provide any links related to this?
0
 
bugadaCommented:
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
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
bugadaCommented:
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
 
Gibu GeorgeCTOCommented:
If you are fetching records on page turn, then you can save it in the servers session object,
0
 
chaitu chaituAuthor Commented:
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
 
chaitu chaituAuthor Commented:
not proper answer
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now