[thelist] how to stop a combo box resetting itself?

Edwin Martin edwin at bitstorm.org
Tue Jun 8 02:13:48 CDT 2004

Millie Niss wrote:

> I have a page in which there are two select input menus, and the choice made
> in the first one sets up the choices for the second one, by some JavaScript
> I wrote.  When you submit the form, via a submit button,  a new page is
> loaded on a frame underneath the menus, with the menu choices determining
> which page is loaded.  This works fine, but unfortunately when you submit
> the form, it also resets the menus to their initial positions, which is
> undesirable.  Normally, the use would want to stay with the setting on the
> first menu, and change the setting on the second menu to see more stuff.
> The problem seems to be that the page is reloaded when the form is
> submitted.  If that's the case, I don't know how (short of server-side
> scripting or a cookie) to restore the values in the menus.  These seem like
> drastic efforts, so I hope someone can suggest something better.

The page with the select-boxes is probably reloaded.

You probably have something like:

<form onsubmit="frame1.location=bottompage...">

This should be:

<form onsubmit="frame1.location=bottompage...; return false">

Best way is to do this:

<form action="bottompage..." target="bottomframe">

You are very sparse about your actual HTML, so it's not easy 
to give the answer right away.

Edwin Martin.

More information about the thelist mailing list