473,387 Members | 1,573 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Dropdown Issue in IE with Dynamically Populated SELECT Field (Bug??)

Hello,

I'm trying to dynamically load a list of teams into a SELECT field
(dropdown / combo box) when a user clicks on the field. (The teams are
pre-loaded into JS arrays via ASP/SQL -- not shown.)

My problem is when I click on the box, the team loading *works*, but
it's performing a funky action. Upon click, it drops down once and the
teams are there. But in a split second (once the box drops down to its
bottom limit) the screen flickers and the box rolls back up to its
original state. (It almost appears as if I clicked twice on the box.)

I've tried onclick, onmousedown, onfocus... none work right. I even
tried appendChild with no luck.

I'm using Internet Explorer to view the page and I'm only targeting IE
since a very small number of users will be loading this page. I loaded
it into Firefox, Netscape and Opera just for kicks, though -- Firefox
and Netscape performed the action correctly and Opera didn't drop
anything down at all. (Nice.)

Anyway, is this a known bug in IE? Something I'm doing wrong? A
combination? Any help would be appreciated.
<select ... size="1" style="width: 175px;"
onmousedown="loadTeams(this)">
<option value="" selected></option>
</select>

<script>
function loadTeams(e) {
e.options.length = 0;
e.options.add(new Option("", "", true, false));

for (i=0; i < teamids.length; i++) {
e.options.add(new Option(teams[i], teamids[i], false, false));
}
}
</script>

Jul 23 '05 #1
4 2503

<ph*********@yahoo.com> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com...
Hello,

I'm trying to dynamically load a list of teams into a SELECT field
(dropdown / combo box) when a user clicks on the field. (The teams
are
pre-loaded into JS arrays via ASP/SQL -- not shown.)

My problem is when I click on the box, the team loading *works*, but
it's performing a funky action. Upon click, it drops down once and
the
teams are there. But in a split second (once the box drops down to
its
bottom limit) the screen flickers and the box rolls back up to its
original state. (It almost appears as if I clicked twice on the
box.)


Why are you triggering the loading on clicking the select itself? You
would be much
better off having the optionsl oaded before the user interacts with
the select.
Tim.
Jul 23 '05 #2
Usually, I would agree. That would make my job *much* easier. ;)

There are several fields on the page and the users can only select the
item once (no duplicates.) Pre-loading would lead to potential
duplication. I could always check for that before submitting the
form... but then a light bulb lit above my head and I thought it would
be snazzier (that's right, I said "snazzier") to have the fields
automatically load the remaining items on each click, thus eliminating
the duplication and verification.

The part that stinks the worst is that the logic works perfectly, but
the browser seems to be doing something funky. I was wondering if
anyone else ran into this (and possibly had a workaround......??)

Jul 23 '05 #3
The same logic applied to load the select when the user clicks on it
can be applied to load the select when the user makes a selection in
any of the other linked lists. Just have the change event delete the
selected option from the other lists.

Tim.
<ph*********@yahoo.com> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com...
Usually, I would agree. That would make my job *much* easier. ;)

There are several fields on the page and the users can only select
the
item once (no duplicates.) Pre-loading would lead to potential
duplication. I could always check for that before submitting the
form... but then a light bulb lit above my head and I thought it
would
be snazzier (that's right, I said "snazzier") to have the fields
automatically load the remaining items on each click, thus
eliminating
the duplication and verification.

The part that stinks the worst is that the logic works perfectly,
but
the browser seems to be doing something funky. I was wondering if
anyone else ran into this (and possibly had a workaround......??)

Jul 23 '05 #4
Great minds think alike. ;)

Thanks for your help, Ted. I actually thought of the same thing
yesterday and implemented it. Works great!

I think what I'm experiencing is a bug or a "quirk", if you will, in
Internet Explorer. I left my original code in the page (commented out)
since it's a lot smaller than the workaround. But after running some
more tests on IE, hope for an actual solution is fading. It seems to
be the way the actual browser behaves and not something I'm doing.

Thanks again!

Jul 23 '05 #5

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

Similar topics

1
by: middletree | last post by:
For an ASp Intranet app, I have some code that should work, but I am not able to make it happen for some reason, after spending considerable time on this. I am pretty thick when it comes to...
2
by: JP SIngh | last post by:
Hi All I just wondering if someone can suggest a solution to this tricky issue we have got. I have an asp form which allow our users to create a new record and save it to the database. On the...
1
by: jzhang29 | last post by:
I have a JSP page and it contains a dropdown list called Office. What I try to do is: When I select different office from this list, the information of office (address, phone,etc) will be...
13
by: melih.onvural | last post by:
Group, I'm having a tough time understanding some of the previous posts on this topic so I wanted to write what I've tried and hope that you can help me troubleshoot. I have a dropdown populated...
3
by: devNorway | last post by:
I have been struggling with a problem for days now, and searched for related problems and solutions but had no luck. I have two dropdown listboxes where the first is populated in page load and...
3
by: Fendi Baba | last post by:
I faced 2 isseues. First, I created three (3) dropdown list on my page. They are populated by an event triggered in the page load command. What's strange is that the frist drop downlist gets...
13
by: Shutey | last post by:
I have a strange issue with dropdowns. Using php4, mySQL5, Apache 2 on a fast XP pro PC, I have a form which requires 5 dropdowns populated with indentical values. I extract the values using SQL...
1
by: redgoals | last post by:
Hi, I have searched the forum for a similar problem but have been unable to find anything. What i am trying to achieve is a dropdown menu which behaves in the following way: 1, Someone...
4
by: zion4ever | last post by:
Hello good people, Please bear with me as this is my first post and I am relative new to ASP. I do have VB6 experience. I have a form which enables users within our company to do an intranet...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.