http://qs1969.pair.com?node_id=589249


in reply to restore the data in combo box on using back button

Hi gowthamtr,

That will depende on how the specific browser you're using implements the back funcionality.

Anyway, if you use javascript to create or change options in forms, you should not use the back button, but a button implemented by you, that will reinitiate the selects to the last selected values.

You can't relay on any default browser behaviour as diferent browsers and even diferent versions of the same browser, or even diferent plugins on the same version of the same browser will work in diferent ways.

TheMage
Talking Web

Replies are listed 'Best First'.
Re: restore the data in combo box on using back button
by gowthamtr (Sexton) on Dec 12, 2006 at 10:13 UTC
    How will u create a button that will reinitiate the selects to the last selected values?

    The values in combo 2 will be loaded only when some event occurs.
      You could just forget about having a back button displayed to go back, and just have the CGI script take you back to the submission page. The CGI script would pass the initial box 2 and box 3 values as parameters to the submission page. You could then use JavaScript to re-set the initial box 2 and box 3 values ...

      There is no reason why you cannot pass around a few cookies either.

      Hi gowthamtr,

      That is an information I can give you without some more information on what you are doing.

      But I presume you could send to the previous page some information on the selected values, and then pre-load the selects and pre-select the correct values when generating the page.

      That's what I've done in the past, in similar events.

      An alternative is to have a javascript that calls the same methods that were called as eventHandlers.

      TheMage
      Talking Web