...

View Full Version : checkbox problems



mrboyer79
02-15-2007, 05:44 PM
hello all,
i'm working on a page where there's a checkbox . when the user checks this box, some text forms and radio buttons appear. when the user un-checks the box, they disappear again. the user, once finished with the page, clicks submit to get to the next page. the issue we are finding is that if the user clicks "back" in the browser, the checkbox remains checked, but the fields are hidden. if the user un-checks the box, the fields reappear. this is obviously backwards. fortunately, the data is still there. what we want to happen is that on going "back", the checkbox would remain checked and the fields underneath would still be displayed. any thoughts???

thanks!

nikkiH
02-15-2007, 09:09 PM
A script that runs onLoad of body to check if that box is checked.

mrboyer79
02-15-2007, 09:25 PM
A script that runs onLoad of body to check if that box is checked.

i'm sorry, can you elaborate? if you need more information from me let me know.

thanks!

nikkiH
02-15-2007, 10:00 PM
You have some function that is run when the user clicks the box, right?
Say onclick="myfunction()" or whatever.
Just call the same function onload so that the code that does whatever hiding/showing needs done will check on the page load.

<body onload="myfunction()">

Then when the user hits the back button, the script will run, see the checked box, and unhide your divs and whatnot. :)

mrboyer79
02-16-2007, 12:37 AM
thanks! that makes sense! :thumbsup:



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum