473,887 Members | 2,286 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Which events fire reliable in IE6 <select>?

Hi everybody,

I nearly get despaired of the fact that the events I chose and,
according to the MSDN site, are correct, don't fire reliable in IE6.
Is someone able to tell me, which events I can use for the following
situation?

I have a <select> list with dynamically generated options. Latest when
I have changed the (pre-) selected option and loose the focus of the
select-list I want to run a function to find out about the newly
selected option and act accordingly.

I tried the events onblur = somefunction(), onfocus = somefunction(),
onselect = somefunction() and even onselectstart = somefunction() and
used them like follows:

<SELECT ID="IDNAME" SIZE="1" ONFOCUS="somefu nction()"
ONBLUR="somefun ction()"></SELECT> in nearly every combination, e.g.
only onfocus or combined as above and with and without the "" around
somefunction().

Unfortunately with neither event somefunction() gets called.

Please note that the solution only has to work in IE6 and not in other
browsers.

Thank you very much in advance,

Andy

Feb 15 '06 #1
5 1564

andreas.maurer1 ...@web.de schrieb:
Hi everybody,

[EDIT]

I forgot to mention that this <select> box is within a frameset.
Just in case that this matters.

Andy

Feb 15 '06 #2
VK

andreas.maurer1 ...@web.de wrote:
andreas.maurer1 ...@web.de schrieb:
Hi everybody,

[EDIT]

I forgot to mention that this <select> box is within a frameset.
Just in case that this matters.


Where do you process the events? In the frame with <select> list or in
some other frame? If in some other frame and these are frames from
different domains then you cannot capture events with default security
settings.

Just to check that your system works:

<select name="foo" onchange="alert (this.selectedI ndex)">
<option selected>1</option>
<option>2</option>
<option>3</option>
</select>

Copy'n'paste as it is into your form and select something. See if alert
pops up.

Feb 15 '06 #3

VK schrieb:
Just to check that your system works:

<select name="foo" onchange="alert (this.selectedI ndex)">
<option selected>1</option>
<option>2</option>
<option>3</option>
</select>

Copy'n'paste as it is into your form and select something. See if alert
pops up.


Hi VK,

thank you for your answer.
I have copied your code into my HTML- file and it works.
Doing the same (simply changeing the function call to the alert(...))
within my <select> list doesn't work.

Could it be that it has something to do with my dynamical creation of
the <option>- tags?

this.IDNAME[0] = new Option("some text", 0 , true, false); // default
selected
this.IDNAME[1] = new Option("some other text", 0 , false, false);
for (var i = 2; i < 10 ; i++) {
this.IDNAME[i] = new Option("some more text", i, false, false); //
some more text is just an example and displays well ;-)
}

I process the event in the same html-file and therefore the same frame.
The function origially was located at the end of the file but now I
have moved it to the <head> part of it. Thank's for asking where I
process it. This might have been another, more difficult to find
mistake.

Andy

Feb 15 '06 #4

an************* ***@web.de schrieb:
VK schrieb:


Hi VK and everyone,

the problem is solved.

The reason for it was that I had a second <select> - tag with the same
id just a few lines above the "real" tag due to some copy/paste.
Of course IE got confused and didn't know where it was.

Sorry for wasting your time but trust me, if a colleague wouldn't have
looked over my shoulders and asked me what the second tag is good for I
never would have found it although I already spent literally hours on
this problem.

Andy

Feb 15 '06 #5
Ha ha ha, that's always the way it is. :) Glad it was solved.

Feb 16 '06 #6

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

Similar topics

1
2423
by: Ang Talunin | last post by:
Hey, I wondering if it's possible to retrieve all the <option>-fields from a <select> when posting a <form> to a php file Example: I've got a form like this: <form action = phpfile.php method=post > <select name= "name">
6
2415
by: Bonge Boo! | last post by:
This has got to be obvious, but I can't make it work. I have a form called with 3 pull down menus. They are linked to a database which generates the values for the <SELECT? Pull-downs. Lets say I have values selected for all three pull down menus. When I change the first "top-level" menu I want to reset both the second and third menus to the "default" state.
5
8330
by: Brian Foley | last post by:
Hello, I am used to using the label tag with check boxes and radio buttons in html forms. This allows me to click on the text of the label to activate/deactivate the check box / button, rather than having to click on the (possibly small) box or button. I recently tried to assign a label to a select "drop down list", but found that when I clicked on the label text to bring it into focus, the select box was reset to the first entry. ...
6
13036
by: Chris Fink | last post by:
Does anyone know it is possible to include a small image(.gif .jpeg) within a <SELECT><option> so that the user would see the option text as well as a little image(icon) in the option? I know this is not an ASP.NET related question, but I know this group is knowledgeable and quick with responses. Thanks
6
19622
by: joseph.lindley | last post by:
Forgive me for I am a bit of a web-dev novice - but I'm not doing too bad. I'm currently working with a bit of javascript to dynamically add <option>s into a select box. My code currently works fine in Internet Explorer, however in Firefox the dropdown only displays the first option in the list, and when clicked the other values aren't displayed. Here is the code;
1
1874
by: frey | last post by:
i tried to create a dropdown menu and use the option as a control to change content inside another text area the code is like this: <select name="xxxx"><option onclick="changeunitprice(29.87)" value="1744"/> the function changeunitprice() is called when an option is selected
4
39440
by: Man-wai Chang | last post by:
-- iTech Consulting Co., Ltd. Expert of ePOS solutions Website: http://www.itech.com.hk (IE only) Tel: (852)2325 3883 Fax: (852)2325 8288
14
10033
mikek12004
by: mikek12004 | last post by:
In a form I have 5 elements (e.g. pictures) and I wish for the user to be able to set the order of appearance. For this I have for each picture a select box (names select1 to select5) with "please select something" as preselected and the rest options are values from 1 to 5. I want when a user selects a number a.k.a ans <option> that number/<option> to be removed from the rest of the select boxes and when the user selects another number the...
0
9957
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
9799
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
11173
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...
0
10434
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9593
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7988
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
6011
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4633
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
4239
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.