Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > How get value of a drop down in Internet Explorer?

Reply
Thread Tools

How get value of a drop down in Internet Explorer?

 
 
antiinertia@gmail.com
Guest
Posts: n/a
 
      04-19-2007
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!

 
Reply With Quote
 
 
 
 
RobG
Guest
Posts: n/a
 
      04-20-2007
On Apr 20, 7:27 am, antiiner...@gmail.com wrote:
> 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.


>
> </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>



--
Rob


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Affecting a dynamically created drop down from another dynamically created drop down. msimmons ASP .Net 0 07-16-2009 03:17 PM
retrive preselected value in second drop down list from the first drop down list weiwei ASP .Net 0 01-05-2007 07:29 PM
Auto Drop down a Drop Down List xxbmichae1@supergambler.com Javascript 5 11-23-2005 01:35 AM
New to .NET, can I have one drop down box control the data of another drop down box using a database? SirPoonga ASP .Net 2 01-07-2005 10:44 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57