| Programming | Newsgroup Tips & Tricks | CubeCart Stuff |
| Subject: How to make onchange cascade other selections |
| From: "john woo" |
| Date: 30 Jun 2005 06:31:45 -0700 |
| Newsgroups: comp.lang.javascript |
| X-Mozilla-Status: 0001 |
| X-Mozilla-Status2: 00000000 |
| Path: bigbe2.bellsouth.net!bigfeed.bellsouth.net!news.bellsouth.net!news.glorb.com!postnews.google.com!o13g2000cwo.googlegroups.com!not-for-mail |
| Newsgroups: comp.lang.javascript |
| Organization: http://groups.google.com |
| Lines: 40 |
| Message-ID: <1120138305.620912.203100@o13g2000cwo.googlegroups.com> |
| NNTP-Posting-Host: 64.135.10.200 |
| MIME-Version: 1.0 |
| Content-Type: text/plain; charset="iso-8859-1" |
| X-Trace: posting.google.com 1120138310 7845 127.0.0.1 (30 Jun 2005 13:31:50 GMT) |
| X-Complaints-To: groups-abuse@google.com |
| NNTP-Posting-Date: Thu, 30 Jun 2005 13:31:50 +0000 (UTC) |
| User-Agent: G2/0.2 |
| Complaints-To: groups-abuse@google.com |
| Injection-Info: o13g2000cwo.googlegroups.com; posting-host=64.135.10.200; posting-account=CQKOjw0AAABTHQs8JeU_Nzjn2ZddlgJb |
| Xref: bigfeed.bellsouth.net comp.lang.javascript:572845 |
Hi
if there are 3 selections, named location,department,employee, the
relationshipe is, in a location there are departments, in a department
there are employees, so for a selected location, there should be a set
of associated departments each of which there should be a set of
employees.
I have an example, but only for 2 selections, like
<form name="location">
<select name="location_category"
onChange="swap
(window.document.the_form.locaiton_category.
options[selectedIndex].text);">
<option selected>...<option>...
<option>...
</select>
<select name="department" multiple>
<option>...
<option>...
<option>...
</select>
</form>
function swap(array)
{
var numbers_select = window.document.the_form;
var the_array = eval(array);
setOptionText(window.document.the_form.location, array);
}
Can any one provide me with workable example
--
Thanks lots
John
Toronto