RE: Update <select> field automatically.

by "Campbell, Rebecca" <Rebecca.Campbell(at)converg.com>

 Date:  Fri, 9 Jun 2000 10:02:49 -0600
 To:  "'Jeremy Brown'" <jeremy(at)localnetamerica.com>,
HTML Writers Guild <hwg-techniques(at)hwg.org>
  todo: View Thread, Original
you have to grab the selectedIndex from the first dropdown and apply it to
the second.  

i haven't tested this out, but it should look something like:

x = document.myForm.state1.selectedIndex;
document.myForm.state2.selectedIndex = x;

of course this only works if the exact same contents are in the exact same
order in both dropdowns, which, in the case of states, it should be.  so,
you'd put the above in a function and then add an onChange event to the
<option> tag and bob's your uncle.  :)

hth,
rebecca
http://www.nerdygirl.com

-----Original Message-----
From: Jeremy Brown [mailto:jeremy(at)localnetamerica.com]
Sent: Thursday, June 08, 2000 5:28 PM
To: HTML Writers Guild
Subject: Update <select> field automatically.


Does anyone know how to have one drop-down list, when an option is
selected, automatically select the same value in another?

For instance:  a user selects their billing state and wants the shipping
state to be automatically selected as the same

Thanks.

--
Jeremy Brown
VP Internet Technologies
Innovative Business Consultants
http://www.ibc2001.com
USA: (937) 277-2000
1-800-398-3007

HWG hwg-techniques mailing list archives, maintained by Webmasters @ IWA

This page is part of a preserved archive of archives.hwg.org. The site is no longer active and its content is not maintained. For enquiries about this archive, write to archive(at)iwanet.org.