Move the focus away

Discussion in 'ASP .Net' started by Samuel Shulman, Jun 14, 2006.

  1. 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
     
    Samuel Shulman, Jun 14, 2006
    #1
    1. Advertising

  2. > 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
     
    Paul Henderson, Jun 14, 2006
    #2
    1. Advertising

  3. It is a server side control so how can I trigger the JavaScript
    Thank you
    Samuel


    "Paul Henderson" <> wrote in message
    news:...
    >> 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
    >
     
    Samuel Shulman, Jun 14, 2006
    #3
  4. > 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" <> wrote in message
    > news:...
    > >> 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
    > >
     
    Paul Henderson, Jun 15, 2006
    #4
  5. Samuel Shulman

    Jan Hyde Guest

    "Samuel Shulman" <>'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)
     
    Jan Hyde, Jun 16, 2006
    #5
  6. 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" <> wrote in message
    news:...
    > "Samuel Shulman" <>'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)
    >
     
    Samuel Shulman, Jun 16, 2006
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. arun venkatesan
    Replies:
    3
    Views:
    594
    velthuijsen
    Apr 21, 2004
  2. Midex
    Replies:
    24
    Views:
    974
  3. Replies:
    6
    Views:
    1,047
    Andrew Thompson
    Dec 6, 2007
  4. Ara.T.Howard
    Replies:
    0
    Views:
    123
    Ara.T.Howard
    Nov 12, 2005
  5. Roger
    Replies:
    3
    Views:
    380
Loading...

Share This Page