Forum Moderators: open

Message Too Old, No Replies

netscape 6/7 problems - back button and losing hidden data

         

natty

11:34 am on Apr 14, 2003 (gmt 0)

10+ Year Member



hi all ,

how nutscrape pantivator ruins my days.. :(

2 pages, 1 submitted to display the next. i have dynamic dropdowns on page 1, so in order to save the details on a back button (from step2), i have had to use a hidden field to hold the data.
problem..
ie6 doesnt like that so ive had to use a cookie for that. (only for ie6 6.0.2600/6.0.2800 it seems.)
problem..
netscape 6.2/7 intermitantly lose the data in the hidden field for no apparent reason.
problem..
netscape 6.2/7 intermitantly lose the ability to do a history.go(-1) .. i think its done like that, may be history.back(). most of the time the browser button will let me go back to step 1 , but sometimes that doesnt work either..

anyone come across any of these problems..
as always any help gratefully recieved.
cheers,
nat

DrDoc

11:40 am on Apr 14, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Do you know any PHP?
You should consider PHP sessions...

natty

11:44 am on Apr 14, 2003 (gmt 0)

10+ Year Member



hi drdoc,

i do know some php, more of a perl chap meself..
sadly for this project im forced to do it this way. and its a nitemare. :(
we use cgi::persistent to maintain the session data, however, customer asked for the JS to do the bulk of the work..
they wanted 'rich functionality', which they will get most of the time, sadly not all. why cant these things be consistent..
so much harder to track down an inconsistent bug ....
any other ideas?

additional.. > it seems that NN7 does not like the hidden field either.. it seems cookies for that too..

ShawnR

12:20 pm on Apr 14, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi

Are you sure the problem is with the hidden fields losing their data (rather than something else)? I apologise for asking the basics, but sometimes looking at the basics helps because your symptoms just seem weird... I've not had a problem with visible fields losing their data when going back, and I can't see why hidden fields should be different...

Just exploring 'the basics' further:

When do you read the hidden fields? i.e. Are you sure the page has completed loading? The hidden fields won't be available at the time you are creating the dynamically created drop-down options, as the page won't have completed loading yet (if what you mean by 'dynamic drop-downs' is what I think you mean).

If you are confident of and have tested the above, another thought is that the browser hits a snag trying to populate the dynamic drop-down's with the info in history, and so gives up on populating the remainder of the form, so one idea is to put the hidden fields in a form of their own, above the normal form, instead of as part of the normal form.

Shawn

natty

1:05 pm on Apr 14, 2003 (gmt 0)

10+ Year Member



hi shawn

cheers for the reply..

ill try to explain the situation better..
page - step 1
a whole load of dropdowns, to be filled in a domino fashion. ie choose something from the first one, it then fills the second.. third.. nth
fill out the rest of the form.
submit the page.
onsubmit does a saveVals()
this function grabs all the data from the dropdowns, bungs it in a long delimited string, decides whether or not the browser is ie6(6.0.2600/2800) and if so uses cookies to hold the string. if its not ie6 then it will stick the string in a hidden field.

onto step 2.
having submitted step 1 the 'user' arrives at step 2 realising (s)he has made a mistake and goes back. via a back button in browser or a history.back link.

back to step 1...
step 1 has an onload function which , depending on the browser(ie6 or no) will load in the values from cookie/hidden field.
i have an alert to see if it hits this function , which it does every time.
i also alert the value that comes back from the field/cookie, and most of the time, its fine (ie6 using cookie/ NN4/6/ie5- using hidden field NN7 seems to need to use cookie too as it never has worked from the hidden field)
once it has got the data back, it dynamically fills the dropdowns again with all this data.

but.. as you prolly know by now, it doesnt work all the time. there seems to be no method to its madness. have tested countless times, with the same data, and still doesnt do it consistently (fails mbe 1 for every 5 works), seems to be a bit more unstable if i use the history.back() in NN6. also NN6 sometimes wont allow me to back at all, using the history.back or the browser..

im most flumoxed.. and kinda annoyed with this now..

ShawnR

1:54 pm on Apr 14, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi Nathan

I can understand your frustration....

Still not 100% clear on the symptoms... Let me get this straight:

Selecting an option in drop-down-1 results in the options for drop-down-2 to be changed? or just causes the default value for drop-down-2 to be filled in automatically?

If the former, does it help to have the hidden field part of a different form, above the visible form?

If the latter, why do you need the hidden field or cookie at all... the visible fields should remember what the selections were when you hit the back button. (Am I missing something or showing my ignorance?)

Is the problem only with Netscape 6 hidden form (i.e. The cookie solution always works reliably)?

Another thing you could try is a debug alert onunload(), to confirm the that the info got written to the hidden field correctly in the first place.

The inconsistant nature makes me think maybe it is something like your cache is full... If you clear out the browser's cache does it alter the behaviour?

Sorry this is not much help...

Shawn

natty

2:17 pm on Apr 14, 2003 (gmt 0)

10+ Year Member



hi again dude,

correct -

Selecting an option in drop-down-1 results in the options for drop-down-2 to be changed?

not simply changed but completely built from scratch and defaulted..

i am checking on the way out that the hidden field has been filled. - it is
havent tried moving the hidden stuff to another form.. why might that help?
i was asked not to use cookies if i could manage not to. so i was trying that all other avenues.. to quote 'people who had cookies turned off, would be losing the rich functionality of the site'..
having messed with nn6.2 a bit more, page2 not loading properly is certainly stopping the ability to go back to step 1.. silly NN.
ill try clearing my cache, but sadly im not the only one testing. and ev1 is finding this :(

amended
may have found an answer to this, we use CGI::Persistent to hold our session data. it uses a '.id' hidden field to hold the persistent key. it seems that when backing to step 1, instead of thinking its the same session, it thinks its a new one, thus losing all the hidden fields, and everything else for that matter..
why would it not use the browser cache tho ?!?!?!?!?
this is somewhat good, as someone else is doing that.. out of my hands.. woo hoo.
however it doesnt get round the fact that NN7 doesnt like the hidden field thing at all.. im guessing its the same prob that ie6.0.2600/2800 has.. cookies again then..

ShawnR

2:49 pm on Apr 14, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi Nathan

moving the hidden stuff to another form.. why might that help

Say your fields are:

visible field 1
visible field 2
hidden field

Say the browser tries to fill the fields when you hit the back button. It gets to fill field 2, but the allowed options don't match the option it is trying to set it to, so it gives up and stops setting the rest of the fields in the form, so the hidden field doesn't get set. Not saying this is it, just that it is a possibility.

Shawn