[Javascript] Making One Selection List Dictate Another's Contents

Trey H tutwabee at hotmail.com
Fri Apr 12 17:36:47 CDT 2002


I have found one solution, but it is a little strange.  My solution involves 
making 2 identical pages exept that one variable is different.  That 
variable contains the other pages location.  I would have used one page, but 
it didn't work for some reason.

First, change the box.html to what you would like it to look like.  Then 
copy the whole source code to the box2.html file.  In the box2.html file 
make sure the sloc variable contains "box.html".

When you change the parent select box on the box.html page it goes to 
box2.html and changes the child select box accordingly.  This sure works 
visa-versa also.  You may need some more help because the values of other 
input fields in forms don't stay the same as what the user made them.  I can 
easily help you with this, but I need to know what your input fields names 
are and I need a rough copy of your page.

====================================
Trey: tutwabee at hotmail.com
Get free JavaScripts at the Blue Dragon!
Just go to:
http://www.websiter.biz
====================================
Make money by being online:
http://www.degoo.com/index.php?refid=tutwabee
===================================
Earn free traffic for your website easily:
http://tools.addme.com/servlet/popview?id=52260
====================================



>From: "Daniel G. Augustine" <daugustine at rlwinc.com>
>Reply-To: javascript at LaTech.edu
>To: <javascript at LaTech.edu>
>Subject: [Javascript] Making One Selection List Dictate Another's Contents
>Date: Fri, 12 Apr 2002 13:23:55 -0400
>
>
>Hey all,
>
>i am still relatively new to javascripting.  There has to be a way to do
>what i want, i just cant figure it out, so im truing to you guys...I want 
>to
>have 2 selection lists on my page, one of which is the "father" list and 
>the
>other is the "child" list.
>
>When a user would select one choice from the first list (father list) the
>script would populate the options for the child list based on the first
>lists's choice.  For example, I have A, B, C, and D in the first list and
>the second list is disabled (i have the code for that all taken care of)
>until one of those A, B, C or D choices is made.  Lets say B is chosen.
>After B is chose, Cat and Dog show up in the child list.  Or, I choose D
>from the father list and then Snake and Rabbit show up in the "child" list.
>
>Note:  This is just an example of how to do this...i mainly just want to
>have control over making the user select a choce form the father list, and
>then haveing a child list enabled with the contents of that child list
>specific to what was chosen in the father list.  Anyway to do this would be
>fine...
>
>ALSO...VERY IMPORTANT...this application is being developed for use with
>Pocket PC's, which means Internet Explorer CE, which in turn means, NO
>Dynamic functions or DHTML supported...i wish i could use it, but i cant!
>any way to do this???
>
>
>Thanks in advance for the help.
>
>Dan
>
>____________________________________________________________________________
>_
>
>Daniel G. Augustine
>Intern
>RLW, Inc.
>(814) 867-5122
>(717)-314-6052 (mobile)
>
>Pennsylvania State University
>Undergraduate Student
>School of Information Sciences and Technology
>http://ist.psu.edu
>
>_______________________________________________
>Javascript mailing list
>Javascript at LaTech.edu
>https://lists.LaTech.edu/mailman/listinfo/javascript


_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.




More information about the Javascript mailing list