Drop Down Box creates text

T

ThunStorm

May I please ask for some assistance. I am trying to write some code
that starts off with a drop down box. When a user selects an option,
it writes text to a table cell. I have tried several combinations and I
am unable to get to work right. Could someone please point me in the
right direction. I would like for the text to look like this:
=============
Mary

Joe

Cindy

Michael
==============
Here is the code I have been working with:

<script>
function display_option ( )
{
switch (document.example2.dropdown.selectedIndex)
{
case 0:
'A': msg=("Karen L. <br><br> Marlene T. <br><br> Joyce A. <br><br>
Mickey Z. ");
break;
case 1:
'B': msg=("Joan T. <br><br> June G. <br><br> Alice G. <br><br> Sandy
B. ");
break;
case 2:
'C': msg=("Mary B. <br><br> Amy S. <br><br> Carol C. <br><br> Dee
V.");
break;
case 3:
'D': msg=("Bev W. <br><br> Fran D. <br><br> Barb F. <br><br> Gerry
B.");
break;
case 4:
'E': msg=("Blind <br><br> Lynda F. <br><br> Gail J. <br><br> Val B.
");
break;
case 5:
'F': msg=("Helen N. <br><br> Sandy S. <br><br> Pat D. <br><br> Blind
");
break;
case 6:
'G': msg=("Dora F. <br><br> Yo P. <br><br> Minnie C. <br><br>
Blind");
break;
case 7:
'H': msg=("<br>You Must Bowl NO <br> LESS THAN ( <INPUT TYPE=text
NAME=PPG SIZE=2 MAXLENGTH=3> ) To <br> Take A Point Per Game!!!");
break;
default:
'': msg=("Pick A Team!!! ");
}
document.getElementById("favorite").value=mylist.options[mylist.selectedIndex].text;
document.write(msg);
};
</script>
</head>

<body>
<table border="1">
<tr>
<td>
<form name=example2>
<select name="dropdown" size="1" onChange="display_option ()">
<OPTION VALUE = A>Select Team</option>
<OPTION VALUE = B>Alley Cats </option>
<OPTION VALUE = C>Blind</option>
<OPTION VALUE = D>Dreamers</option>
<OPTION VALUE = E>Lucky Strikes </option>
<OPTION VALUE = F>Morn D. Lites </option>
<OPTION VALUE = G>Pin Pals</option>
<OPTION VALUE = H>Pin Ups</option>
<OPTION VALUE = I>Ups + Downs</option>
</SELECT> <br>
</td>
<td>&nbsp;</td>
</tr>
<tr>
<td><textarea id="favorite" wrap="logical" rows="10"
cols="42"></textarea></td>
<td></td>
</tr>
</form>
</table>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top