
February 6th, 2002, 01:52 PM
|
|
Junior Member
|
|
Join Date: Jan 2002
Posts: 2
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
JavaScript SELECT box problem
Hi y'all
Can anyone figure out a problem with this? It's probably stupidly simple but I can't spot it.
Look at URL - you can see that the script is meant to display a message on the right-hand side of the page, depending on what is chosen from the drop-down box on the left. BUT the script won't let you select anything other than the very last item (in IE6). Why?
Here's the code:
Code:
<textarea name="add" style="float:right;background-color:white;color:black;font-family:Arial,Helvetica,Monaco;size:normal;border:0px;width:350px;overflow:visible">
</textarea>
<form method="post" action="" name="listpanes">
<select name="comID" onChange="changeDescription()">
<option value="">+select+</option>
<option value="">msg one</option>
<option value="">msg two</option>
</select>
</form>
<SCRIPT LANGUAGE="JavaScript" type="text/javascript">
function changeDescription() {
if(document.listpanes.comID.selectedIndex="1") {
add.value='Message ONE';
add.disabled=1;
}
if(document.listpanes.comID.selectedIndex="2") {
add.value='Message TWO';
add.disabled=1;
}
}
</script>
Last edited by Jefferrs : February 6th, 2002 at 01:55 PM.
|