473,796 Members | 2,648 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

select bug in IE

Hi

I'm trying to dynamically add content to a select box when it is
clicked (because the app that I am developing contains many, many
select boxes with huge lists that are just way too slow to populate on
page load).

I have written code that works fine in gecko based browsers but in
Internet Explorer 6 after the select is populated, it is resized and
the popup is closed before the user can select an option. I have tried
returning false from onmousedown/onmouseup/onclick if the select is not
yet populated, I have tried setting a timeout to call the Click()
method (or the onclick/onmouseup/onmousedown method) if it isn't
populated but I can't seem to stop the popup list disappearing in IE6.

Any ideas appreciated.
(Stripped-down example code follows)

<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">
<html>
<head>
<title>Select Bug TestBed</title>
<script>
function LazyPopulate(el em)
{
if(elem.populat ed == null)
{
//Copy the list items across
for(var j = 1 ; j < 10 ; j++)
{
elem.options[j]=new Option("new"+j, "value"+j);
}
elem.populated= true;
}
}
</script>
</head>
<body>
<select id="sel" onclick="LazyPo pulate(this);">
<option>first </option>
</select>
</body>
</html>

Jul 23 '05 #1
2 1903
JonQuark wrote:
Hi

I'm trying to dynamically add content to a select box when it is
clicked (because the app that I am developing contains many, many
select boxes with huge lists that are just way too slow to populate on page load).

I have written code that works fine in gecko based browsers but in
Internet Explorer 6 after the select is populated, it is resized and
the popup is closed before the user can select an option. I have tried returning false from onmousedown/onmouseup/onclick if the select is not yet populated, I have tried setting a timeout to call the Click()
method (or the onclick/onmouseup/onmousedown method) if it isn't
populated but I can't seem to stop the popup list disappearing in IE6.
Any ideas appreciated.
(Stripped-down example code follows)

<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">
<html>
<head>
<title>Select Bug TestBed</title>
<script>
function LazyPopulate(el em)
{
if(elem.populat ed == null)
{
//Copy the list items across
for(var j = 1 ; j < 10 ; j++)
{
elem.options[j]=new Option("new"+j, "value"+j);
}
elem.populated= true;
}
}
</script>
</head>
<body>
<select id="sel" onclick="LazyPo pulate(this);">
<option>first </option>
</select>
</body>
</html>


You mentioned 'popup', as in...'popup window'? Unclear.

Try the onfocus handler instead. How 'huge' are we talking here? #:=0

Jul 23 '05 #2
Hi Rob,
You mentioned 'popup', as in...'popup window'? Unclear. I mean that when you click on a select box, a list of options "pops
up", if you dynamically change the list of options in the
onclick/onmousedown handler, IE (But not Firefox) closes this list of
options (try the example HTML at the top of this thread if I'm still
being unclear)
Try the onfocus handler instead.

Thanks for the suggestion but if the lazypopulate() routine is called
there, IE still closes the options-list.

How 'huge' are we talking here? #:=0
It's a big Intranet app for an internal project, we have a lot of data
on a page, normally
there are maybe 20 or 30 selects on a page each with a maximum of 20
or 30 options. However it is the edge cases that make this
lazypopulate() so attractive.
It is possible to have hundreds of selects on a page with some of them
having a few hundred options. In testing it is very slow, but as the
user only wants to alter a few of these selects the lazypopulate fixes
it. In Gecko browsers now, we have an increasingly slick front-end but
we can't stipulate W3C compliant browsers only for this project
unfortunately.

Any other thoughts or ideas appreciated.

Jon.

Jul 23 '05 #3

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

Similar topics

1
5257
by: JT | last post by:
I have an input form for which I've created a "matrix" for user input. Basically, the user chooses a radio button and then through javascript, a select box is displayed to define a value for that radio option, like so: Choice: (Radio1) type: (select box1) Choice: (Radio1) type: (select box2) Choice: (Radio1) type: (select box3) Choice: (Radio1) type: (select box4) Choice: (Radio1) type: (select box5)
4
6954
by: Elroyskimms | last post by:
Using SQL 2000... tblCustomer: CustomerID int CompanyName varchar(20) HasRetailStores bit HasWholesaleStores bit HasOtherStores bit tblInvoiceMessages:
4
7404
by: bobsawyer | last post by:
I've been building a series of SELECT lists that are populated dynamically using HTTPRequest. Things are going pretty well, and I've got the whole thing working flawlessly in Mozilla/Firebird. Unfortunately, Internet Explorer doesn't quite work as expected -- it gives me an "invalid argument" error that I don't know how to fix. Here's the entire script, with form, annotated to explain what I'm doing and where the problem is occurring. I...
3
5732
by: dumbledad | last post by:
Hi All, I'm confused by how to replace a SELECT statement in a SQL statement with a specific value. The table I'm working on is a list of words (a column called "word") with an index int pointing to the sentence they come from (a column called "regret"). I also have a table of stop words (called "GenericStopWords") that contains the words I do not want to consider. That table has a single column called "word". I started off using a...
10
5640
by: serge | last post by:
Using "SELECT * " is a bad practice even when using a VIEW instead of a table? I have some stored procedures that are identical with the difference of one statement in the WHERE clause. If I create a single View and specify also in this View the WHERE clause that is common in these stored procedures, I will have the new stored procecures changed to be like:
1
2970
by: serena.delossantos | last post by:
Trying to insert into a history table. Some columns will come from parameters sent to the store procedure. Other columns will be filled with a separate select statement. I've tried storing the select return in a cursor, tried setting the values for each field with a separate select. Think I've just got the syntax wrong. Here's one of my attempts: use ESBAOffsets go
9
51990
chunk1978
by: chunk1978 | last post by:
hey everyone, i've been trying to solve this problem for 2 days straight, with no end in sight. i would greatly appreciate anyone's help. EXPLANATION: There are 3 Select Menus. The 1st and 2nd Select Menu are "printing options" for 4x6 and 5x7 prints respectively. the 3rd Select Menu holds an "Email" option that can be toggled (appear/reappear) by the 1st and 2nd Select Menus. So if a user selects prints from either 4x6 or 5x7 menu,...
2
3928
by: naima.mans | last post by:
Hello, i want to select 2 following brothers nodes wich are one under another (one closed to another)... i have done one xslt file... but it's not really good.. for example: the xml file: ----------------------------------------------------- <loanService>
4
4400
by: rn5a | last post by:
A Form has 2 select lists. The 1st one whose size is 5 (meaning 5 options are shown at any given time) allows multiple selection whereas the 2nd one allows only 1 option to be selected at a time. When an option is selected in the 2nd select list, the ASP page posts itself. Assume that the 1st select list has the following 10 options (note that both the select lists are actually populated from 2 different database tables): Australia
6
3395
by: Apaxe | last post by:
In the database i have a table with this information: key_id =1 key_desc =43+34+22+12 I want sum the values in key_desc. Something like: SELECT key_desc FROM table But the result of the select was "111" and not "43+34+22+12".
0
9535
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
10465
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
10200
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,...
0
10021
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
9061
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
7558
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
6800
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();...
1
4127
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
3744
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.