473,473 Members | 1,805 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Move the focus away

I have a common problem that when the user changed the selection in the
DropDownList control and the program responded appropriately the focus
remains there and if the user will press on the Arrow Up or arrow down
buttons the selection of the DropDown will change which is not normally
required

Is there any way to remove the focus away from the dropdown control?

Thank you

Samuel
Jun 14 '06 #1
5 2235
> I have a common problem that when the user changed the selection in the
DropDownList control and the program responded appropriately the focus
remains there and if the user will press on the Arrow Up or arrow down
buttons the selection of the DropDown will change which is not normally
required
Is there any way to remove the focus away from the dropdown control?


Perhaps the easiest way to do this would be to put some Javascript to
be executed on the client side after the user changes their selection
in the dropdown; you can call the this.blur() method in the client-side
Change event for the dropdown to remove the focus from it.

-- PH

Jun 14 '06 #2
It is a server side control so how can I trigger the JavaScript
Thank you
Samuel
"Paul Henderson" <pa***********@pittville.demon.co.uk> wrote in message
news:11**********************@g10g2000cwb.googlegr oups.com...
I have a common problem that when the user changed the selection in the
DropDownList control and the program responded appropriately the focus
remains there and if the user will press on the Arrow Up or arrow down
buttons the selection of the DropDown will change which is not normally
required
Is there any way to remove the focus away from the dropdown control?


Perhaps the easiest way to do this would be to put some Javascript to
be executed on the client side after the user changes their selection
in the dropdown; you can call the this.blur() method in the client-side
Change event for the dropdown to remove the focus from it.

-- PH

Jun 14 '06 #3
> It is a server side control so how can I trigger the JavaScript

If you add an onchange attribute containing the Javascript to the
control from your Page_Load event, then it'll be run when the user
changes the selection [I'm presuming there's no postback until the user
explicitly clicks Submit or whatever]. The attribute should just be
attached to the <select...> tag created by the server control.

So use
my_dropdown . Attributes . Add( "onchange", "this.blur();" ) ;

-- PH

"Paul Henderson" <pa***********@pittville.demon.co.uk> wrote in message
news:11**********************@g10g2000cwb.googlegr oups.com...
I have a common problem that when the user changed the selection in the
DropDownList control and the program responded appropriately the focus
remains there and if the user will press on the Arrow Up or arrow down
buttons the selection of the DropDown will change which is not normally
required
Is there any way to remove the focus away from the dropdown control?


Perhaps the easiest way to do this would be to put some Javascript to
be executed on the client side after the user changes their selection
in the dropdown; you can call the this.blur() method in the client-side
Change event for the dropdown to remove the focus from it.

-- PH


Jun 15 '06 #4
"Samuel Shulman" <sa************@ntlworld.com>'s wild
thoughts were released on Wed, 14 Jun 2006 18:48:35 +0100
bearing the following fruit:
I have a common problem that when the user changed the selection in the
DropDownList control and the program responded appropriately the focus
remains there and if the user will press on the Arrow Up or arrow down
buttons the selection of the DropDown will change which is not normally
required

Is there any way to remove the focus away from the dropdown control?


As a side note I'm surprised you refer to this as a 'common
problem' I see it as essential and expected behavior.

Jan Hyde (VB MVP)

--
A procrastinator has wait problems. (Shawn Kennedy)

Jun 16 '06 #5
It is useful some times but on other occasion users want to scroll down the
page after they selected an entry from the list
"Jan Hyde" <St***********@REMOVE.ME.uboot.com> wrote in message
news:4o********************************@4ax.com...
"Samuel Shulman" <sa************@ntlworld.com>'s wild
thoughts were released on Wed, 14 Jun 2006 18:48:35 +0100
bearing the following fruit:
I have a common problem that when the user changed the selection in the
DropDownList control and the program responded appropriately the focus
remains there and if the user will press on the Arrow Up or arrow down
buttons the selection of the DropDown will change which is not normally
required

Is there any way to remove the focus away from the dropdown control?


As a side note I'm surprised you refer to this as a 'common
problem' I see it as essential and expected behavior.

Jan Hyde (VB MVP)

--
A procrastinator has wait problems. (Shawn Kennedy)

Jun 16 '06 #6

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

Similar topics

5
by: Martin | last post by:
I have the following function in the onchange event of several text boxes. If the user enters an invalid number the alert displays. I would like to return the user to that same field after he...
2
by: Jay Villa | last post by:
I have a SSN Field which include 3 text boxes. How do I move the focus from one box to another as soon as user enter the max characters in the text box. For example: when users enter 123 in the...
7
by: Seash | last post by:
Hi friends , here is the sample code private void txtbox_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e) { if(e.KeyChar == 13) //enter { txtbox2.Focus(); }
0
by: Mynfred | last post by:
Hi, all, I found a strange question about OCX in VB.net, the OCX is crearted by VC++.net, and I put it on the VB.net Form, in OCX, there are many edit box, on the VB.net form, there are many...
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...
1
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...
0
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,...
1
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...
0
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...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
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...

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.