Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
|
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 13th, 2004, 06:00 PM
Friend of Wrox
 
Join Date: Jun 2004
Posts: 106
Thanks: 0
Thanked 0 Times in 0 Posts
Default three independant select menus

Hi, I tried looking in previous threads to find my answer but to no avail. So here I go again requesting your help.

I have three independant list menus from which to choose from.
The results of a selection are driven by the

" onChange="checkMenu(this.options[this.selectedIndex].value) " javascript call, and are loaded in another frame.
So far, all is fine.

My problem is when I've made a first selection and would like to make another selection, from say another of the list menus, The first selection doesn't "reset" itself. It stays as the first element in that drop-down but is no longer clickable.

Ideally I would like that once a selection has been made; ALL drop-downs reset themselves.

Any help would greatly be appreciated,

Thanks
nancy






 
Old December 13th, 2004, 10:07 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

"ALL drop-downs reset themselves"

Including the one you just selected from?

If so, put the menus in a form and change the onChange handler to this:
onChange="checkMenu(this.options[this.selectedIndex].value);this.form.reset()

hth,

-Snib - http://www.snibworks.com
Where will you be in 100 years?
 
Old December 14th, 2004, 10:12 AM
Friend of Wrox
 
Join Date: Jun 2004
Posts: 106
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Snib for the quick response, but I'd tried that and it still doesn't reset the select menus to there initial state??

 
Old December 14th, 2004, 11:10 AM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

I'm assuming your select menus look similar to this:

<select name='blah' onchange='blah'>
<option>blah</option>
<option>blah blah</option>
[other options]
</select>

Wrap ALL of the select menus in a form like this:

<form method='post' action='/'>
[all 3 select menus here]
</form>

Then make sure the onChange looks exactly like this:
onChange="checkMenu(this.options[this.selectedIndex].value);this.form.reset()"

If this doesn't work, please post an example and I'll take a look.

-Snib - http://www.snibworks.com
Where will you be in 100 years?
 
Old December 14th, 2004, 11:36 AM
Friend of Wrox
 
Join Date: Jun 2004
Posts: 106
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hey Snib... It worked!!
Thanks sooo much!







Similar Threads
Thread Thread Starter Forum Replies Last Post
Images in menus EricJ VB How-To 13 April 26th, 2005 04:09 AM
sub menus matshediso HTML Code Clinic 2 January 31st, 2005 05:15 AM
Popup menus over <select> boxes tdaustin Javascript How-To 6 July 7th, 2004 06:30 PM
Menus Frank Schmuck BOOK: Beginning ASP.NET 1.0 1 June 6th, 2003 01:29 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.