Hi! I recently started adding Javascript to my html pages and I am learning it as fast as I can. I am very stuck right now, though. I have a dropdown list that has all the volenteer opportunities listed. When they pick something, a corresponding paragraph is written into a textarea. Well, I apparently can't put hyperlinks or formatted text into a textarea, and I really need them. I read about Document.write, which WILL do formatted text, but when I used onchange="document.write(shortcut.text.value)" instead of onchange="showtext()" it goes off to another window or something and writes it there. Putting the document.write statement by itself after the select box works one time, but won't change if they select something else from the drop-down list.
Is there some way to have different formatted, hyperlinked paragraphs appear and change each time they select something different from a drop-down list?
Just sign me,
Baffled and Stuck,
-Susan
<form name="combowithtext">
<select name="example" size="1" onchange="showtext()">
<option>Book Sales
</option><option>Build Team
</option><option>Bus Ministry/Drivers
</option><option>Drama Ministry
</option></select>
<br>
<textarea rows="5" cols="21" wrap="virtual" name="text"></textarea>
<script language="javascript">
<!--
var shortcut=document.combowithtext
var descriptions=new Array()
//extend this list if neccessary to accomodate more selections
descriptions[0]="Assist with book sales and inventory."
descriptions[1]="Assist with carpentry, painting and set design"
descriptions[2]="Drive or monitor on bus routes"
descriptions[3]="Communicate the message through drama productions, commercials, skits and human videos"
shortcut.text.value=descriptions[shortcut.example.selectedIndex]
function showtext(){
shortcut.text.value=descriptions[shortcut.example.selectedIndex]
;
}
//-->