Drop-Down Lists

G

Guest

I have created 3 drop-down lists so people can search by one of 3 different
criteria for a page. They choose one of the three menus, click go, and it
opens up a new window with the page. But when they return to the "search"
page I want the lists to revert back to "Please choose one" as default.
Right now it won't change even if I refresh the page. Any help is
appreciated. Thanks!
 
S

Stefan B Rusynko

Since you are opening a new page/window (on change of the drop down) you are not changing anything on the page w/ the drop down menu
- you will need a JavaScript that both resets the drop down and opens the link

--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
To find the best Newsgroup for FrontPage support see:
http://www.frontpagemvps.com/FrontPageNewsGroups/tabid/53/Default.aspx
_____________________________________________


|I have created 3 drop-down lists so people can search by one of 3 different
| criteria for a page. They choose one of the three menus, click go, and it
| opens up a new window with the page. But when they return to the "search"
| page I want the lists to revert back to "Please choose one" as default.
| Right now it won't change even if I refresh the page. Any help is
| appreciated. Thanks!
 
J

Jon Spivey

Hi Natalie,
You'd need some script to reset the list boxes, eg
<form.......
<select name="box1".....
<option value="">Please Choose</option>
....options.....
</select>
<select name="box2".....
<option value="">Please Choose</option>
....options.....
</select>
<select name="box3".....
<option value="">Please Choose</option>
....options.....
</select>
<script type="text/javascript">
var a = document.forms[0].elements;
for(i=0;i<a.length;i++)if(a.type.toLowerCase().indexOf('select')>-1)a.selectedIndex=0;
</script>
 
G

Guest

Jon,
This is awesome, thank you! One more question though....I am new to
scripts, and it is only resetting the first of my 3 drop-downs. I don't know
if I need to copy the script and somehow alter it for each? I probably
should have mentioned the 3 lists all operate independently, so they are 3
different "forms". Right now, with your script, the first one will re-set to
"Please choose one" when I return to the page, but the others will not.

I am so thankful for your help, I've been working on this issue all day and
it's wearing me out!

Natalie

Jon Spivey said:
Hi Natalie,
You'd need some script to reset the list boxes, eg
<form.......
<select name="box1".....
<option value="">Please Choose</option>
....options.....
</select>
<select name="box2".....
<option value="">Please Choose</option>
....options.....
</select>
<select name="box3".....
<option value="">Please Choose</option>
....options.....
</select>
<script type="text/javascript">
var a = document.forms[0].elements;
for(i=0;i<a.length;i++)if(a.type.toLowerCase().indexOf('select')>-1)a.selectedIndex=0;
</script>


--
Cheers,
Jon
Microsoft MVP


Natalie H said:
I have created 3 drop-down lists so people can search by one of 3 different
criteria for a page. They choose one of the three menus, click go, and it
opens up a new window with the page. But when they return to the "search"
page I want the lists to revert back to "Please choose one" as default.
Right now it won't change even if I refresh the page. Any help is
appreciated. Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top