Dear forum,

I've written a web page in which a <select> element uses the
"onchange" attribute to advance to another page instead of requiring
the user to pick an option from the select menu and then click a
"submit" button.

One problem with this, however, is that if the user clicks their back
button after using the <select> menu, the previously selected value
remains in place.

Please visit this mini-example page, a cgi-script written in python,
for a clearer example of what I mean:

  http://flash.uchicago.edu/~nttaylor/selectTest.py

There is a select menu with choices 'a', 'b', and 'c'.  The default it
a blank linke. There is an instruction to pick one of the choices.

Try selecting one, for example, 'b'.  The page changes to say "you
selected 'b'" The select menu still appears, only now the default is
'b', the logic being that since you just selected 'b',  there's no
point in selecting it again.  Instead, all other options are
available, and the "onchange" instructions will be executed if the
user chooses one of them.  This is correct behavior, as I see it.

But now try clicking your back button.  If your browser is like mine,
you will once again see the "Please select 'a', 'b', or 'c'" message,
but the select menu will still be stuck on 'b' instead of reverting to
the blank line.

So my question is, how can I get the select menu to return to the
state it was in when you first arrived at the page?  I don't want to
use "document.form.reset()" because that would also prevent the menu
from displaying the "correct" behavior described above, where the menu
does reflect the user's choice.  I don't want to blank out the fields
every time; I want the browser to remember the full state of each
visit to the page and reflect that state in the form values.

I hope this question is clear.  Can anyone help?

with thanks,

N Taylor
______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7 information -- http://css-discuss.incutio.com/?page=IE7
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to