Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jul 2002
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Double Combo - Back Button - not repopulating list

    Hi All,

    I am using the Cut & Paste Double Combo (Requires NS 3.x, 4.x, or IE 4.x) (http://javascriptkit.com/script/cut183.shtml). Everything works fine until i go to one of the selected links and then use the back button to return to the page with the combo boxes. When i return to the page the first combo box remains on the choice i originally selected but the associated child selections are blank. I then must choose another parent selection for the other choices to appear. Also i cannot choose the same selection i made before jumping to the link without first selecting something else otherwise the child list box remains blank.

    the script is being used on www.teetimeshawaii.com front page.

    Thanks for any and all help!

    rw

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Posts
    349
    Thanks
    2
    Thanked 0 Times in 0 Posts
    hmmm,

    well, the second drop down is created dynamically - so when you leave the page...it erases in memory..........the first box is a "form" element that is static..so it will default to the last selection.

    what can you do?..hmm, I see two options...

    1. pass two numbers in the URL string that represent the group and its first position..BUT that is too much work.........

    2. create an invisibile frame (ala frameset)....and create a function that passes the "value" selected into this invisible frame to "hold" the values....so, when you go back..you 'reference' these values in the invisible frame and then "repopulate" the drop down....here is a basic example snippets..

    other frame code..
    <script language="javascript">
    var selectValueholder
    function holdValue(Val){
    selectValueholder=Val;
    }
    </script>

    in first select box:
    onChange="redirect(this.options.selectedIndex),document.otherframename.holdValue(this.options.select edIndex)"

    in body tag onload
    checkValue();

    function checkValue(){
    if (document.otherframe.holdValue.selectValueholder){
    redirect(document.otherframe.holdValue.selectValueholder);
    }
    }

  • #3
    New to the CF scene
    Join Date
    Jul 2002
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Originally posted by BrightNail
    [B]hmmm,

    well, the second drop down is created dynamically - so when you leave the page...it erases in memory..........the first box is a "form" element that is static..so it will default to the last selection.

    what can you do?..hmm, I see two options...

    Thanks for your reply..

    Actually the script works totally fine on the page i referenced where i got the script (this site). But for some reason on my site it doesn't work. it would be great if it had default values that would be fine. But it doesn't on my page. Again it works great on the page where i got the script.. Not sure what i have done different outside of using a table in the form..

    I don't need it to hold the previous values, that would be great but i don't want to use frames.. If i could just get it to do what it does in the example that would be (have default values so when you hit back something shows in the second list).. I don't know if they have some extra code on the page that makes it refresh or what..


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •