Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-26-2002, 04:30 PM   PM User | #1
rwfresh
New to the CF scene

 
Join Date: Jul 2002
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
rwfresh is an unknown quantity at this point
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
rwfresh is offline   Reply With Quote
Old 07-26-2002, 11:15 PM   PM User | #2
BrightNail
Regular Coder

 
Join Date: Jun 2002
Posts: 349
Thanks: 2
Thanked 0 Times in 0 Posts
BrightNail is an unknown quantity at this point
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);
}
}
BrightNail is offline   Reply With Quote
Old 07-29-2002, 04:02 PM   PM User | #3
rwfresh
New to the CF scene

 
Join Date: Jul 2002
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
rwfresh is an unknown quantity at this point
Quote:
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..
rwfresh is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:26 PM.


Advertisement
Log in to turn off these ads.