7

I want to call method on Press-"TAB" but not on "Shift + Tab".

$(".txtPaymentMessage").keydown(function(e)
            {
                if(e.keyCode == 9)
                {
                    alert("You Press Tab Only");
                }
    });
Anoop LL
  • 1,548
  • 2
  • 21
  • 32
user3405179
  • 184
  • 11
  • I don't think there is an "easy" way. See here: [link](http://stackoverflow.com/questions/5203407/javascript-multiple-keys-pressed-at-once) – SEUH Aug 30 '16 at 06:24
  • 2
    @SEUH - There is an easy way for shift and/or ctrl and/or alt plus one other key: the `event` object tells you directly. – nnnnnn Aug 30 '16 at 06:24
  • @SEUH Thanks for (http://stackoverflow.com/questions/5203407/javascript-multiple-keys-pressed-at-once) it's helpfull for me. – user3405179 Aug 30 '16 at 06:45

1 Answers1

6

Hope this works

$(".txtPaymentMessage").keydown(function(e)
        {
            if(e.which  == 9 && !e.shiftKey)
            {
                alert("You Press Tab Only");
            }
});
Anoop LL
  • 1,548
  • 2
  • 21
  • 32