473,795 Members | 3,439 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

client-side onclick populates dropdown

I wrote a function to populate my dropdowns on the client-side.

The function adds <optionelemen ts to the <selectonly if none are
initially present.

I call the population function from either the onfocus or onclick event of
the <selectas follows :

onclick="popula teDropdown(this );return true;"

It works in Firefox.

In IE, the dropdown is populated but the default handler for the click event
is not invoked, thus requiring the user to click the dropdown twice : once
to populate it and once to drop it down.

Does anyone know what is going on and a workaround for what appears to be an
IE bug ?

May 13 '07 #1
5 2033
Why don't you just return true in populateDropdow n and call it as
onclick="return populateDropdow n(this)"?

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"John Grandy" <johnagrandy-at-gmail-dot-comwrote in message
news:%2******** *******@TK2MSFT NGP06.phx.gbl.. .
>I wrote a function to populate my dropdowns on the client-side.

The function adds <optionelemen ts to the <selectonly if none are
initially present.

I call the population function from either the onfocus or onclick event of
the <selectas follows :

onclick="popula teDropdown(this );return true;"

It works in Firefox.

In IE, the dropdown is populated but the default handler for the click
event is not invoked, thus requiring the user to click the dropdown twice
: once to populate it and once to drop it down.

Does anyone know what is going on and a workaround for what appears to be
an IE bug ?

May 14 '07 #2
What's the difference ?

"Eliyahu Goldin" <RE************ **************@ mMvVpPsS.orgwro te in
message news:%2******** ********@TK2MSF TNGP05.phx.gbl. ..
Why don't you just return true in populateDropdow n and call it as
onclick="return populateDropdow n(this)"?

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"John Grandy" <johnagrandy-at-gmail-dot-comwrote in message
news:%2******** *******@TK2MSFT NGP06.phx.gbl.. .
>>I wrote a function to populate my dropdowns on the client-side.

The function adds <optionelemen ts to the <selectonly if none are
initially present.

I call the population function from either the onfocus or onclick event
of the <selectas follows :

onclick="popul ateDropdown(thi s);return true;"

It works in Firefox.

In IE, the dropdown is populated but the default handler for the click
event is not invoked, thus requiring the user to click the dropdown twice
: once to populate it and once to drop it down.

Does anyone know what is going on and a workaround for what appears to be
an IE bug ?


May 14 '07 #3
John,

I would pre-populate the dropdowns before User clicks on them, say when the
page is loaded, but if you need to wait until User decides to use your
control, you can try to work around the IE issue by placing the following (or
similar) code in onmousemove event:
<select onmousemove='pr ePopulate(this) ' ...

<script ...
function prePopulate(ddn ){
if (ddn.options.le ngth == 0)
// call your populate function:
populateDropdow n(ddn);
}

it seems to be working fine for smaller lists (up to a few hundred items)

HTH

"John A Grandy" wrote:
What's the difference ?

"Eliyahu Goldin" <RE************ **************@ mMvVpPsS.orgwro te in
message news:%2******** ********@TK2MSF TNGP05.phx.gbl. ..
Why don't you just return true in populateDropdow n and call it as
onclick="return populateDropdow n(this)"?

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"John Grandy" <johnagrandy-at-gmail-dot-comwrote in message
news:%2******** *******@TK2MSFT NGP06.phx.gbl.. .
>I wrote a function to populate my dropdowns on the client-side.

The function adds <optionelemen ts to the <selectonly if none are
initially present.

I call the population function from either the onfocus or onclick event
of the <selectas follows :

onclick="popula teDropdown(this );return true;"

It works in Firefox.

In IE, the dropdown is populated but the default handler for the click
event is not invoked, thus requiring the user to click the dropdown twice
: once to populate it and once to drop it down.

Does anyone know what is going on and a workaround for what appears to be
an IE bug ?


May 15 '07 #4
Hi Sergey and thanks for the response.

I have been using onmousedown , which works for IE7 and Firefox, but not
IE6.

Which browsers have you tested onmousemove with ?
"Sergey Poberezovskiy" <Se************ *****@discussio ns.microsoft.co mwrote
in message news:90******** *************** ***********@mic rosoft.com...
John,

I would pre-populate the dropdowns before User clicks on them, say when
the
page is loaded, but if you need to wait until User decides to use your
control, you can try to work around the IE issue by placing the following
(or
similar) code in onmousemove event:
<select onmousemove='pr ePopulate(this) ' ...

<script ...
function prePopulate(ddn ){
if (ddn.options.le ngth == 0)
// call your populate function:
populateDropdow n(ddn);
}

it seems to be working fine for smaller lists (up to a few hundred items)

HTH

"John A Grandy" wrote:
>What's the difference ?

"Eliyahu Goldin" <RE************ **************@ mMvVpPsS.orgwro te in
message news:%2******** ********@TK2MSF TNGP05.phx.gbl. ..
Why don't you just return true in populateDropdow n and call it as
onclick="return populateDropdow n(this)"?

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"John Grandy" <johnagrandy-at-gmail-dot-comwrote in message
news:%2******** *******@TK2MSFT NGP06.phx.gbl.. .
I wrote a function to populate my dropdowns on the client-side.

The function adds <optionelemen ts to the <selectonly if none are
initially present.

I call the population function from either the onfocus or onclick
event
of the <selectas follows :

onclick="popul ateDropdown(thi s);return true;"

It works in Firefox.

In IE, the dropdown is populated but the default handler for the click
event is not invoked, thus requiring the user to click the dropdown
twice
: once to populate it and once to drop it down.

Does anyone know what is going on and a workaround for what appears to
be
an IE bug ?





May 17 '07 #5
John,

I was testing on IE6 - and on it onmousedown works the same as onclick -
that is why I used onmousemove - then it seems to work just fine.

"John A Grandy" wrote:
Hi Sergey and thanks for the response.

I have been using onmousedown , which works for IE7 and Firefox, but not
IE6.

Which browsers have you tested onmousemove with ?
"Sergey Poberezovskiy" <Se************ *****@discussio ns.microsoft.co mwrote
in message news:90******** *************** ***********@mic rosoft.com...
John,

I would pre-populate the dropdowns before User clicks on them, say when
the
page is loaded, but if you need to wait until User decides to use your
control, you can try to work around the IE issue by placing the following
(or
similar) code in onmousemove event:
<select onmousemove='pr ePopulate(this) ' ...

<script ...
function prePopulate(ddn ){
if (ddn.options.le ngth == 0)
// call your populate function:
populateDropdow n(ddn);
}

it seems to be working fine for smaller lists (up to a few hundred items)

HTH

"John A Grandy" wrote:
What's the difference ?

"Eliyahu Goldin" <RE************ **************@ mMvVpPsS.orgwro te in
message news:%2******** ********@TK2MSF TNGP05.phx.gbl. ..
Why don't you just return true in populateDropdow n and call it as
onclick="return populateDropdow n(this)"?

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"John Grandy" <johnagrandy-at-gmail-dot-comwrote in message
news:%2******** *******@TK2MSFT NGP06.phx.gbl.. .
I wrote a function to populate my dropdowns on the client-side.

The function adds <optionelemen ts to the <selectonly if none are
initially present.

I call the population function from either the onfocus or onclick
event
of the <selectas follows :

onclick="popula teDropdown(this );return true;"

It works in Firefox.

In IE, the dropdown is populated but the default handler for the click
event is not invoked, thus requiring the user to click the dropdown
twice
: once to populate it and once to drop it down.

Does anyone know what is going on and a workaround for what appears to
be
an IE bug ?





May 17 '07 #6

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

Similar topics

15
4494
by: Michael Rybak | last post by:
hi, everyone. I'm writing a 2-players game that should support network mode. I'm now testing it on 1 PC since I don't have 2. I directly use sockets, and both client and server do computations, the only data transfered is user mouse/kbd input. It works synchronously, but somehow, when I play in client window, both client and server have 17 fps, while when playing in server window, server has 44 fps while client ...
2
3035
by: Raquel | last post by:
How do I know whether the 'runtime client' and the 'application development client' are installed on my machine? When I issue the command "db2licm -l", it gives the following output: Product Name = "DB2 Personal Edition" Product Password = "DB2PE" Version Information = "8.1" Expiry Date = "Permanent" Annotation = "" Other information = ""
2
4673
by: Rhino | last post by:
I am trying to verify that I correctly understand something I saw in the DB2 Information Center. I am running DB2 Personal Edition V8.2.1 on Windows. I came across the following in the Info Center: To return a result set from a procedure to the originating application, use the WITH RETURN TO CLIENT clause. When WITH RETURN TO CLIENT is specified on a result set, no nested procedures can access the result set.
0
2169
by: Harley | last post by:
Hello, I am just learning the tcp/ip functions etc under vb.net so please look over me if this is obviouse. I have been all over looking into any functions that I didn't totaly understand and can't see that I am doing anything wrong (i obviousely am though) everything "works", client connects to server and when anything is sent to the server it starts the mp3 and passes all messages the way i ment for it to except that my server is...
8
2747
by: Ankit Aneja | last post by:
i am doing here some some socket-client work in C# windows service it is working fine for multiple clients now i want to limit these multiple clients to 25 for example i want that when service starts objects for all these 25 clients are created and when client connects it should be accepted and will not allow more than 25 clients to connect and when client diconnects that object can be allocated to another client who requests i am not...
2
1992
by: Delmar | last post by:
I need to build Web Application that will generate a client to execute some operations. Each client has running silent application. Maybe somebody can advice me what can I do ? Thank you.
2
7579
by: J Huntley Palmer | last post by:
I am having a horrific time integrating uw-imap's c-client for imap support in php. The problem is a whole bunch of "Text relocation remains referenced against symbol" errors during linking. Any help appreciated! The ordeal is a follows I am using Solaris 10 with php5.1.1. GCC:
0
1747
by: khu84 | last post by:
Here is client server very simple code, seems to work with telnet but with with web client code gives blank output. Following is the server code:- <?php function createSocketServer($host='192.168.1.34',$port=2222) { $max_clients = 10;
2
4104
by: nsaffary | last post by:
hi I hava a client/server program that run correctly when i run it in one computer(local) but when I run client on a one computer and run server run on another, connection does not stablish.(I set server machine IP for client and server) please guide me? server : #include <winsock2.h> #include <iostream> #include <stdio.h> #include <string.h> #include <windows.h> #pragma comment(lib, "ws2_32");
0
9672
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...
1
10164
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
10001
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
9042
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
7538
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
5437
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4113
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
3723
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2920
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.