I am new to java programming and this question is related to checkbox.
Here is the scenario:
1. I am in page A and it has few links with checkboxes.
2. I select few check boxes.
3. Proceed to next page.
4. Come back to previous page,the checked boxes are unchecked.
How to fix this problem?
Does this question relate to
Does this question relate to CSS?
You really need a scripting forum for this sort of question.
Moving to 'Off Topic'
Quote:I am new to java
I am new to java programming
Come back to previous page,the checked boxes are unchecked.
If it's Via the Back button (the way everyone in the world does it and more, pls stay away frm JS'd "back" buttons, they're evil) then two things are happening:
Either you've (or someone) turned browser caching off. Check to see if it's on.
Checkboxes sound like a form. Forms which send information (instead of forms which do searches and bring back search results via GET) are normally POST as their sending-to-server method. Using POST requires that your HTTP Headers are set to no-cache, no-store. What this does is make FireFox ask you something about resending information, while IE just dies (er, only after the user has hit SUBMIT, and then the Back button).
If you have a POST form without the no-cache, no-store you might still have the browser thinking it shouldn't cache (because it shouldn't)-- if the user has hit SUBMIT. There are two ways to "fix" this:
One, use a "persistant session" (google it, I dunno nothin about them) to track the user and temporarily hold the user's info in memory until their session ends--so when they hit Back, it's the server remembering what they've filled in, not the browser.
Two, with real submitting-stuff forms, there's a method called POST-request-GET (I think, I forget), where the POST sends the user info to the server, which then has an add-on script with a GET request for the page (or the previous page, I forget). So long as there's a GET request later, the browser can "see" its history, and go back... I'm not 100% sure if this will also still remember what was filled in before SUBMIT though.
I'm thinking if these are filled in and you're NOT hitting SUBMIT then it's pure browser caching. Use a session.