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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problem with dropdown and back button

Status
Not open for further replies.

GUJUm0deL

Programmer
Jan 16, 2001
3,676
US
Hiya everyone, I have a problem:
If you go here: and select something for the following choices (Select 'Office Supplies' 'Paper' 'Computer Paper') and then hit the submit button...
After you hit that button, the choices you selected you will see on the action page, now this is where my problem happens, if you hit the browser back button, you will see that ONLY the value for CHOICE1 is shown, but the values for CHOICE2 and CHOICE3 are back to the 'Choose One' option...
Why?? I know this has something to do with the JavaScript, but can't figure out what. I've been looking at it for over a week now, and it gives me a headache...
Thanks... I have not failed; I have merely found 100,000 different ways of not succeding...
 
hi GUJUm0deL
the link is not working. page not found A language that doesn't affect the way you think about programming is not worth knowing.
admin@onpntwebdesigns.com
 
Odd, I just viewed it again...
After you get that error message, try refreshing...it shouldn't happen...
Where are you at?? I mean state/country... I have not failed; I have merely found 100,000 different ways of not succeding...
 
I tried the usual already clear ctrl+ F5 refresh several times change the _ to space etc. etc.

wisconsin
can't see how that would effect a thing though.

let's see if anyone else can view and then I'll figure out what I did to my machine this time. [lol] A language that doesn't affect the way you think about programming is not worth knowing.
admin@onpntwebdesigns.com
 
I also posted this question in the COLDFUSION forum, and someone there could visit the site...this the thread232-373944
Hmmm, peculiar thing this com-pu-ter is... I have not failed; I have merely found 100,000 different ways of not succeding...
 
I just loaded your page, no problems here.

I did what you asked for: selected items and pressed Submit. Then I hit "back" and... surprise!.. I saw ALL 3 selections I made.
How is it possible? Very simple - I use Opera! The best choice for advanced users.

What I'm trying to tell is that why should you change the browser's default behaviour a hard way? (And this behaviour is different.) What's the purpose? I never had a chance to see a case where it is _really_ necessary.

Maybe this is not so useful for you, but I tried to show you the problem from another side.

Anyway, there could be a problem in dynamic change of select lists (I didn't check your code). Also, I'd try to move the script to the <head>, place it into function and call on document load the process of automatic initialization of the lists: depending on previous list the options of the next one are set.
 
I agree with starway, in terms of speed and functionality, Opera can't be beat. The only problem it has are some minor (to me anyway) DOM inconsistencies.

Mozilla is a nice alternative too (NOT netscape).

GUJUm0deL I tried your page and it seems fine here, haven't tried it with mozilla though, sorry. BTW, mozilla now comes with a Javascript debugger :D
Maybe it can help? &quot;Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.&quot; - Rich Cook
 
Hmmm, seeing that this application is made for ppl. who use IE and NS...the notion of using Opera is outta my hand...[smile]...
So then there's no way to get the choice2 and choice3 to retain their values when the back button is pressed?? Hmmm, is it then possible to do something like this:

if (browser.button.back == clicked) {
page.clear
}

What i'm thinking about doing is IF the user hits the browser back button the page clear...BUT I will have a link that will pass all the values to another page so they can edit again if they made a mistake or realize their error...
Know what I mean?? Passing the values forward is a piece of cake, its the reverse process that's a pain-in-the-tukus...
Any ideas?? Thanks... I have not failed; I have merely found 100,000 different ways of not succeding...
 
Yes this is an option. I thought about passing the chosen values to the first page in URL string, and then re-initialize select lists (like I said before), but I didn't think it's so important and it worth the efforts.
 
Hi, i'm not using JS to pass the variables, i'm using ColdFusion and SQL...
The only JS I have on the pages is basic validation and this dropdown menu choice...
Still have no luck in having the browser retain the values of CHOICE2 and CHOICE3...[sad] I have not failed; I have merely found 100,000 different ways of not succeding...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top