Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

dropdown and checkbox validation

Status
Not open for further replies.

palbc06

MIS
Joined
Mar 19, 2006
Messages
4
Location
US
Hello all,
I have a form which has a drop down. Selecting each option in the drop down shows a set of check boxes corresponding with the selection.

So for dropdown option A - check box options could be a,b,c,d,e and for dropdown option B - check box options could be f,g,h,i,j.

Everything works fine and the user can select a dropdown and corresponding options to go to the next page.

However if they click the back button to come back to the page, I can see the dropdown with the last selected option.

But I canot see the checkboxes.

Any thoughts??

Thank you very much.
Pal
 
The reason why is because the browser is keeping track of the values for the form elements when you come back (this is not 100% reliable across all browsers so I wouldn't depend on it). However, the css values for visibility or display are not retained because they are not form values.

If this is behavior that you wish to work consistently across multiple browsers then I would write a cookie when you navigate away from the page storing all the information that you want retained. In the event that the page is reloaded via the back button you can then use the values in the cookie to repopulate the page to the status that you desire.

Take note that I say "work consistently across multiple browsers" depends largely on whether the user has cookies enabled (which is usually the case).

-kaht

[small] <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <.</B>[/small]
[banghead] [small](He's back)[/small]
 
kaht, you could also just call a function onload to rehide/reshow the necessary checkboxes. my uncertainty lies on whether or not onload is called when a page is accessed from a back button...



*cLFlaVA
----------------------------
[tt]( <P> <B>)13 * (<P> <.</B>)[/tt]

[URL unfurl="true"]http://www.coryarthus.com/[/url]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top