This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes HTML, CSS and JavaScript and the fly likes Disable/Enable tab key Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Disable/Enable tab key" Watch "Disable/Enable tab key" New topic
Author

Disable/Enable tab key

farhath farook
Ranch Hand

Joined: Aug 01, 2007
Posts: 37
hi all,
i am having an input filed to which the YUI autosearch is bind.
I need the tab key event in this field to be disabled till the search result is returned ( not being able to use the TAB key to go to the next input filed before the search result returns )
and when there s a selection being done( this should be able even by the TAB key ) from the list the tab key being enable, so that can navigate to the next field using the TAB key.


thanks in advance
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30356
    
150

First, consider other approaches before reducing accessibility and usability. It isn't nice to "trap" the user in a field. What if the internet connection goes down and the search results don't get returned?

Why "only" disable the tab key? What if the user clicks outside the field? If you really want to do this, I think it would be better to use the onBlur event to prevent leaving the field at all rather than just via the tab key.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
jQuery in Action, 2nd edition
 
subject: Disable/Enable tab key