471,072 Members | 1,389 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,072 software developers and data experts.

Safari Issue

I have a strange issue with safari.
My intention was to capture for the keystroke and increment and decrement a particular test box value by 1 or -1.The following is my code.

Expand|Select|Wrap|Line Numbers
  1.     var y=x.value
  2.     var VK_UP = 38;
  3.     var VK_DOWN = 40;
  4.     switch (e.keyCode){
  5.         case VK_UP : {    y++;                        
  6.                      break}
  7.         case VK_DOWN : {y--;
  8.                         break}
  9.         default : {return};
  10.     }
  11.     x.value=y
  12. }
This works for both IE and firefox. But its working for Safari in MAC machine in a strange way. The value i was getting after a key press is either +/-2 rather than +/-1.Can anyone help to solve this issue?

Nov 15 '07 #1
1 897
101 Expert 100+
Can you show us how do you attach the event handler?
Nov 15 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

5 posts views Thread by sanj | last post: by
4 posts views Thread by Nitronic | last post: by
21 posts views Thread by Doug Lerner | last post: by
12 posts views Thread by effendi | last post: by
16 posts views Thread by Edward | last post: by
5 posts views Thread by Liam | last post: by
7 posts views Thread by David Stone | last post: by
15 posts views Thread by GinnTech | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.