Well, I don't know how dynamic you're trying to be with this, but I figure 
it's probably good to start simple.  It could get trimmed down, but more 
complicated with arrays.  But for a quick and easy to figure out 
solution... you might want to try this...

<script language="Javascript"><!--
function populatefields(selection){
         if (selection==""){
                 document.formname.field1.value="";
                 document.formname.field2.value="";
         }
         if (selection=="spot"){
                 document.formname.field1.value="canine";
                 document.formname.field2.value="male";
         }
         if (selection=="stephen"){
                 document.formname.field1.value="human";
                 document.formname.field2.value="male";
         }
         if (selection=="mary"){
                 document.formname.field1.value="human";
                 document.formname.field2.value="female";
         }
}
//-->
</script>


<form name="formname" action="#" method"post">
<select name="name" onChange="populatefields(this[this.selectedIndex].value)">
<option value=""></option>
<option value="spot">Spot</option>
<option value="stephen">Stephen</option>
<option value="mary">Mary</option>
</select>
<br>
<input type="text" name="field1"><br>
<input type="text" name="field2"><br>

<input type="submit" value="Submit">
</form>

I hope that helps, if not... feel free to email me off list.

Stuart Duncan
MaracasMedia Inc.


At 11:17 AM 5/16/01 -0600, you wrote:
>I know this is Off Topic, but I've really spent the last day trying to 
>find an answer (my JavaScript skills are not that good, and I can not find 
>a good resource/mailing list to assist).
>
>What I'm trying to do is populate two different text boxes, with different 
>text, base on the selection from a dropdown box. JavaScript response sought.
>
>So, if the drop down is Stephen, Mary, Spot
>They would fill the boxes (called species and gender) with
>
>Stephen --> Human, Male
>Mary --> Human, Female
>Spot --> Canine, Male
>
>Could anyone help or help point me in the right direction? I could also 
>use a few suggestions of JavaScript mailing lists to add to my archive 
>system too! So I don't need to OT: anymore.
>
>In all cases, thank you for your time and your patience with this post.
>
>Stephen R. Cassady
>[EMAIL PROTECTED]
>
>http://www.tallylist.com  <--- You know you wannnnnnnnna
>
>
>Archives: http://www.mail-archive.com/[email protected]/
>Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to