Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Replace keycode value in Firefox

 
Chinni Bujji
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have the following javascript to tab to the next input box on tab/period
which works fine in Internet Explorer
but in Firefox the . also shows in the input box becoz i am not able to skip the keycode 46 in firefox

please help me on this


 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64833
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Chinni Bujji wrote:... in the input box becoz i am not able to skip the keycode 46 in firefox

Please use real words when posting to the forums. Abbreviations such as "becoz" in place of "because" only serve to make your posts more difficult to read and less likely to generate useful responses.

Please read this for more information.

thanks,
bear
JavaRanch sheriff
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
use onkeydown instead of onkeypress [guessing that is what you are using.] Cancel the event and than set focus to the next box.

Eric
 
Chinni Bujji
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes Eric I am using the key press event
I changed it to keydown but how do i cancel that event and focus

thanks
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Cancel it by using return false and you can focus using focus() on the element

Eric
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic