Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Move the focus away

Reply
Thread Tools

Move the focus away

 
 
Samuel Shulman
Guest
Posts: n/a
 
      06-14-2006
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


 
Reply With Quote
 
 
 
 
Paul Henderson
Guest
Posts: n/a
 
      06-14-2006
> 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

 
Reply With Quote
 
 
 
 
Samuel Shulman
Guest
Posts: n/a
 
      06-14-2006
It is a server side control so how can I trigger the JavaScript
Thank you
Samuel


"Paul Henderson" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) 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
>



 
Reply With Quote
 
Paul Henderson
Guest
Posts: n/a
 
      06-15-2006
> 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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed) 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
> >


 
Reply With Quote
 
Jan Hyde
Guest
Posts: n/a
 
      06-16-2006
"Samuel Shulman" <(E-Mail Removed)>'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)

 
Reply With Quote
 
Samuel Shulman
Guest
Posts: n/a
 
      06-16-2006
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> "Samuel Shulman" <(E-Mail Removed)>'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)
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Firefighters at the site of WTC7 "Move away the building is going to blow up, get back the building is going to blow up." Midex Python 24 05-07-2007 04:23 AM
this.window.focus() vs. window.focus() vs. this.focus() Roger Javascript 3 03-08-2007 08:53 PM
[SCIRUBY] how the move from pdp-11 assembler to ruby took stevejenkins' breath away Ara.T.Howard Ruby 0 11-12-2005 03:51 PM
I am trying to move spaces to a weblistbox and when I move them... Eduardo78 ASP .Net Web Controls 0 11-03-2005 06:06 PM
OT: Why I should move far away MitchS MCSE 0 10-24-2005 03:27 PM



Advertisments