Does the tab key override the onblur event?

Discussion in 'Javascript' started by Rithish Saralaya, Nov 2, 2004.

  1. Does the tab key override the onblur event? I have a text field whose
    input I validate on blur, and set the focus back again if invalid.
    Effectively, I do not want the user to move out of the control unless
    the data entered is validated. This works fine, when I try to click on
    some other control. However, on tabkey press, the onblur does get
    fired, but the focus also moves onto the next control. It gives a user
    experience of hopping onto the next control and coming back again to
    the current. I believe tab key is a system key, and it cannot be
    overridden. But, should it not move out only after the necessary event
    executions?

    Any suggetions would be greatly appreciated.

    I am using IE 6.0 for my tests.

    Regards,
    Rithish.
     
    Rithish Saralaya, Nov 2, 2004
    #1
    1. Advertising

  2. [snip]
    > So stop f**king

    [snip]
    I asked for suggestions.. Not abuses..


    [snip]
    > and look to a better strategy for validating input.

    [snip]

    My belief was that the best way to validate input would be on fire of
    the onblur event. If you have a better strategy of validating input,
    then do please oblige..


    [snip]
    > What are your users using? ..and
    >
    > Will they be prepared to switch off JS so they can use your site
    > the way *they* want to, or is yout site a 'back-button job' like
    > most others that mess with the user's browser?

    [snip]

    This is for an intranet system and my users ARE also using IE 6. They
    want a validation of the input and hence WILL not switch of JS in
    their browsers.


    [snip]
    > Those are perhaps the questions you *should* be asking.

    [snip]

    My questions have not been answered in any case.
    Does the tab key override the onblur event?
    I believe tab key is a system key, and it cannot be overridden. But,
    should not the focus move out only after the necessary event
    executions?


    Regards,
    Rithish.
     
    Rithish Saralaya, Nov 4, 2004
    #2
    1. Advertising

  3. Rithish Saralaya

    Randy Webb Guest

    Rithish Saralaya wrote:
    > [snip]
    >
    >>So stop f**king

    >
    > [snip]
    > I asked for suggestions.. Not abuses..


    Welcome to Usenet, c.l.j in particular

    >
    > [snip]
    >
    >>and look to a better strategy for validating input.

    >
    > [snip]
    >
    > My belief was that the best way to validate input would be on fire of
    > the onblur event. If you have a better strategy of validating input,
    > then do please oblige..


    Use the onchange event instead.


    --
    Randy
    comp.lang.javascript FAQ - http://jibbering.com/faq
     
    Randy Webb, Nov 4, 2004
    #3
    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. Stefan Mueller

    How to control the tab key with onBlur

    Stefan Mueller, Jan 26, 2006, in forum: HTML
    Replies:
    0
    Views:
    1,596
    Stefan Mueller
    Jan 26, 2006
  2. M P
    Replies:
    1
    Views:
    475
  3. Peloux
    Replies:
    3
    Views:
    225
    Fred Oz
    Feb 10, 2005
  4. Stefan Mueller

    How to control the tab key within onBlur

    Stefan Mueller, Jan 26, 2006, in forum: Javascript
    Replies:
    4
    Views:
    216
    Stefan Mueller
    Jan 28, 2006
  5. HopfZ
    Replies:
    0
    Views:
    294
    HopfZ
    Jan 8, 2007
Loading...

Share This Page