473,657 Members | 2,806 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How get value of a drop down in Internet Explorer?

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="javas cript">
function copyDescription () {

document.myForm .Description.va lue=document.my Form.MakeDescri ption.value
}
</script>

<form name="myForm" id="myForm">
<SELECT name="MakeDescr iption" onChange="copyD escription();">
<OPTION selected value="">Choose </OPTION>
<OPTION>A</OPTION>
<OPTION>B</OPTION>
<OPTION>C</OPTION>
</SELECT>
<br /><br />
<input name="Descripti on" id="Description " type="text" />
</form>

Any help appreciated!

Apr 19 '07 #1
2 14353
an*********@gma il.com said the following on 4/19/2007 5:27 PM:
How does one find the value of a drop down in Internet Explorer?
Assign it a value attribute.
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?
<option value="A">A</option>

IE doesn't correlate the value of a select as being the text of a select
element.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javas cript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Apr 19 '07 #2
On Apr 20, 7:27 am, antiiner...@gma il.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="javas cript">
The language attribute is deprecated, type is required.

function copyDescription () {

document.myForm .Description.va lue=document.my Form.MakeDescri ption.value}
Since your options don't have value attributes but do have text
attributes, you can use:
document.myForm .Description.va lue=document.my Form.MakeDescri ption.text;
Why doesn't IE follow the W3C spec? Dunno.

>
</script>

<form name="myForm" id="myForm">
<SELECT name="MakeDescr iption" onChange="copyD escription();">
<OPTION selected value="">Choose </OPTION>
<OPTION>A</OPTION>
<OPTION>B</OPTION>
<OPTION>C</OPTION>
</SELECT>
<br /><br />
<input name="Descripti on" id="Description " type="text" />
</form>

--
Rob
Apr 20 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3524
by: Xerxes | last post by:
Hi, how can I pass the returned value from Javascript to PHP? I have: ------------------------------------------------------------------------ ------ if ( x>y) {
1
1578
by: TJ | last post by:
I have a java/html question. Why does a drop down select box display the values of the drop down on the web page in Netscape communicator where as it displays correctly in a drop down box in internet explorer? What is the solution for this? Thanks in advance!
1
3995
by: ehm | last post by:
I apologize in advance for the cross-post (from microsoft.public.inetexplorer.scripting), but that board seems dead. I have what I think is a fairly simple problem, but I cannot figure this out. I have a SELECT object on my page. When the user performs a certain action, I want the focus to be placed in the drop-down field AND the actual list of drop-down objects to appear (i.e. simulating that the user has clicked in that field). ...
1
2296
by: Smriti Dev | last post by:
Hi, I have a drop down menu with a listing of communities and I use it to select a community, selecting a letter ie. "T" , I get bumped to the "T" section to choose communities that start with a "T". I need to get the "T" communities to start at the top of the community list in the drop-down box. Right now the communities starting with the letter you choose, are atthe bottom of the list and so you have to scroll more.
3
2972
by: Bilal | last post by:
Hi, I've been looking all over the net for a way to increase the size of a drop down menu without any success. Does anyone perhaps have a way to display 11-15 items on a menu without having recourse to: 1. scroll bar. 2. configuring IE 3. decreasing the size of the font. Here is the code I used for my Drop down Menu: ______________ <select style="background-color: #FFFFFF; width:300;" size="1"
7
6520
by: Larry R Harrison Jr | last post by:
I am looking for javascript and a basic tutorial on how to make mouse-over drop-down menus--the type that when you "hover" over a subject links relevant to that subject "emerge" which you can then "hover" over and click. (see the links left on http://www.dpreview.com to see what I mean) I have code from smartwebby.com (DHTML) but I'm not sure if it's the best, and I'm not sure how to integrate any menus of my own into it. The code...
3
4295
by: Reb | last post by:
Hi, I am using drop down menu in my pages. In one of my page,there is a listbox control below the menu. This listbox control is hiding the drop down menu items. How can i make the drop down menu not to be hidden by the listbox control? I tried to increase the z-index for the menu control. But it did not help.
0
2861
by: Yavuz Bogazci | last post by:
Hi, i have build a form with a listbox and the function that he user can drag and drop files from the windows explorer in this listbox. this works for me when i start it on my localmachine. But when i put my Apps .exe file on my WebServers WWWROOT directory and call it from the internet explorer. the application starts with the following error message.
1
1723
by: StevePBurgess | last post by:
Hi I am using a drop down menu adapted from the one in Stylin with CSS by Charles Wyke Smith. The CSS is below. It works perfectly in Internet Explorer (using the csshover behaviour file) but in Firefox (and presumably other standards compliant browsers) it indents the menu on the screen then indents the drop down box by (seemingly) the same amount. So, there is a gap between the edge of the screen and the first item in the menu and...
0
8403
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8316
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8833
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8509
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6174
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5636
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4327
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2735
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1967
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.