show hide divs - show last state upon reload/post



I'm currently working on a form which consists of a show and hide
javascript. The toggle works fine, although when I click on submit, I
would like the page to reload with the toggle (show/hide) div in the
same state it was before being submitted. E.G. If the div was
visible, I'd like for it to be visible upon return.
Here's the script I'm currently using - thanks for any help,
Louis

--------------------------------------------

<script language="javascript" type="text/javascript">
function WM_toggle(id){
if (document.all){
if(document.all[id].style.display == 'none'){
document.all[id].style.display = '';
} else {
document.all[id].style.display = 'none';
}
return false;
} else if (document.getElementById){
if(document.getElementById(id).style.display == 'none'){
document.getElementById(id).style.display = 'block';
} else {
document.getElementById(id).style.display = 'none';
}
return false;
}
}
</script>
.



Relevant Pages

  • Re: show hide divs - show last state upon reload/post
    ... The toggle works fine, although when I click on submit, I ... If the div was ... When you post a form in a window in a frameset, only that window is refreshed, not the window holding the frameset definition. ...
    (comp.lang.javascript)
  • Re: Problem with javascript in web page.
    ... I have this javascript function in the head ... The first line in the div is a bookmark. ... This will toggle fine but it does not jump to the very top of the page ...
    (microsoft.public.scripting.jscript)
  • Re: toggle several elements
    ... I currently use a js toggle function that works well for toggleing the ... first div. ... if (msCurrentDivID) ... msCurrentDivID = displayDivID ...
    (microsoft.public.scripting.jscript)
  • Re: Problem with javascript in web page.
    ... You can safely delete this first clause. ... The first line in the div is a bookmark. ... This will toggle fine but it does not jump to the very top of the page ...
    (microsoft.public.scripting.jscript)
  • Problem with javascript in web page.
    ... I have this javascript function in the head ... The first line in the div is a bookmark. ... This will toggle fine but it does not jump to the very top of the page ...
    (microsoft.public.scripting.jscript)