hi. i stumbled across this javascript snippet that allows a user to select an option from a drop down list box and when they select something, it will put a description in a textbox. this script has worked wonders for small things, but when i went to use it for a larger drop down list with about 250 items, it all of a sudden will not work. is there something that needs to be changed? Thanks!
[code]
<select name=”chargenumber” class=”dropdown” onChange=”changecontent(this)” size=”5″>
<option value=”1″>something</option>
<option value=”2″>somethig else</option>
<option>etc.</option>
</select>
<textarea rows=”6″ name=”phrase” cols=”100″ wrap=”virtual” class=”textarea”></textarea>
<script language=”JavaScript”>
var thecontents=new Array()
thecontents[1]=”some text goes here”
thecontents[2]=”some more text goes here”
thecontents[3]=”etc.”
function changecontent(which){
document.addcharge.phrase.value=thecontents[which.selectedIndex]
}
document.addcharge.phrase.value=thecontents[document.addcharge.selectbox.selectedIndex]
</script>
except in my case, i have about 250 entries in the array. What exactly is wrong? thanks for your help!
oh yeah, i keep getting an error saying that that “changecontent” is not defined. but i only get this error on the big list. thanks for any help!