Links

Lists

Latest Updates

Ruby On Rails List
Python list
Advanced Java
The JavaScript List
Apache Users
Full Disclosure
Linux Security

Search the archives!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • From: javascript@xxxxxxxxxx (Trey H)
  • Subject: [Javascript] Making One Selection List Dictate Another's Contents
  • Date: Fri, 12 Apr 2002 22:41:14 +0000

This is a multi-part message in MIME format.

------=_NextPart_000_5a7a_27cb_2227
Content-Type: text/plain; format=flowed

I am sorry, the attachments were lost on this last email for some reason.  I 
will try again.  I hope the attachments are there.  They should be box.html 
and box2.html  They may appear at the bottom of this email depending on your 
email provider.


>From: "Trey H" <tutwabee@xxxxxxxxxxx>
>Reply-To: javascript@xxxxxxxxxx
>To: javascript@xxxxxxxxxx
>Subject: Re: [Javascript] Making One Selection List Dictate Another's 
>Contents
>Date: Fri, 12 Apr 2002 22:36:47 +0000
>
>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@xxxxxxxxxxx
>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@xxxxxxxxxx>
>>Reply-To: javascript@xxxxxxxxxx
>>To: <javascript@xxxxxxxxxx>
>>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@xxxxxxxxxx
>>https://lists.LaTech.edu/mailman/listinfo/javascript
>
>
>_________________________________________________________________
>Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.
>
>_______________________________________________
>Javascript mailing list
>Javascript@xxxxxxxxxx
>https://lists.LaTech.edu/mailman/listinfo/javascript




====================================
Trey: tutwabee@xxxxxxxxxxx
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
====================================


_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com

------=_NextPart_000_5a7a_27cb_2227
Content-Type: text/html; name="box.html"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment; filename="box.html"

<html>
<head>
<title></title>
<script>
<!--
var sloc = "box2.html";  // The other page name (its shortened version)

var ploc = location.href;
var aft = '';
if(ploc.indexOf("#")!=-1) {
aft = ploc.substring(ploc.indexOf("#")+1,ploc.length);
}
function sChange() {

var theParent = document.form.parent.value; // Change this if needed


parent.location=sloc+"#"+theParent;
}
// -->
</script>
</head>

<body>
<center>
<form name=form>
<select name=parent onChange='sChange();'>
<option value="A">A
<option value="B">B
<option value="C">C
<option vlaue="D">D
</select>

<select name=child>
<script>
<!--

// Substitute out "A" in the if statement
if(aft=="A") {
document.write('<option value="Dog">Dog');  // Change the option commands to your likeing
document.write('<option value="Cat">Cat');
}
if(aft=="B") {
document.write('<option value="Monkey">Monkey');
document.write('<option value="Elephant">Elephant');
}
if(aft=="C") {
document.write('<option value="Bird">Bird');
document.write('<option value="Rabbit">Rabbit');
}
if(aft=="D") {
document.write('<option value="Snake">Snake');
document.write('<option value="Frog">Frog');
document.write('<option value="Camel">Camel');
}
// -->
</script>
</select>
</form>
</body>
</html>

------=_NextPart_000_5a7a_27cb_2227
Content-Type: text/html; name="box2.html"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment; filename="box2.html"

<html>
<head>
<title></title>
<script>
<!--
var sloc = "box.html";  // The other page name (its shortened version)

var ploc = location.href;
var aft = '';
if(ploc.indexOf("#")!=-1) {
aft = ploc.substring(ploc.indexOf("#")+1,ploc.length);
}
function sChange() {

var theParent = document.form.parent.value; // Change this if needed


parent.location=sloc+"#"+theParent;
}
// -->
</script>
</head>

<body>
<center>
<form name=form>
<select name=parent onChange='sChange();'>
<option value="A">A
<option value="B">B
<option value="C">C
<option value="D">D
</select>

<select name=child>
<script>
<!--

// Substitute out "A" in the if statement
if(aft=="A") {
document.write('<option value="Dog">Dog');  // Change the option commands to your likeing
document.write('<option value="Cat">Cat');
}
if(aft=="B") {
document.write('<option value="Monkey">Monkey');
document.write('<option value="Elephant">Elephant');
}
if(aft=="C") {
document.write('<option value="Bird">Bird');
document.write('<option value="Rabbit">Rabbit');
}
if(aft=="D") {
document.write('<option value="Snake">Snake');
document.write('<option value="Frog">Frog');
document.write('<option value="Camel">Camel');
}
// -->
</script>
</select>
</form>
</body>
</html>

------=_NextPart_000_5a7a_27cb_2227--