How can I differentiate between the delete and "." key (keycode 46)?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Suresh
    New Member
    • Sep 2005
    • 4

    How can I differentiate between the delete and "." key (keycode 46)?

    Hi all,

    Here is my code,

    [CODE=javascript]if(event.which)
    keycode = event.which;//For Mozilla
    else
    keycode = event.keyCode;//For IE
    [/CODE]
    But my problem is, the value of keycode returns 46 for pressing "DELETE" key and "." key.

    How can I differentiate this?

    Please help me with code in both the browsers.

    Thanks for all the help.

    Regards,
    Suresh.
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    Use 190 for the "." key.

    Comment

    Working...