How get value of a drop down in Internet Explorer?

A

antiinertia

How does one find the value of a drop down in Internet Explorer?

The form below works in Firefox and Safari. But not in Internet
Explorer. Can someone tell me how to code this so IE understands it?

<script language="javascript">
function copyDescription() {

document.myForm.Description.value=document.myForm.MakeDescription.value
}
</script>

<form name="myForm" id="myForm">
<SELECT name="MakeDescription" onChange="copyDescription();">
<OPTION selected value="">Choose</OPTION>
<OPTION>A</OPTION>
<OPTION>B</OPTION>
<OPTION>C</OPTION>
</SELECT>
<br /><br />
<input name="Description" id="Description" type="text" />
</form>

Any help appreciated!
 
R

RobG

How does one find the value of a drop down in Internet Explorer?

The form below works in Firefox and Safari. But not in Internet
Explorer. Can someone tell me how to code this so IE understands it?

<script language="javascript">

The language attribute is deprecated, type is required.

function copyDescription() {

document.myForm.Description.value=document.myForm.MakeDescription.value}

Since your options don't have value attributes but do have text
attributes, you can use:


document.myForm.Description.value=document.myForm.MakeDescription.text;


Why doesn't IE follow the W3C spec? Dunno.
 

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

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top