0

I have a file named fiche.aspx which is tied to a master page.

In the master page there is a button click calculete_somehing.

When I pull up fiche.aspx and press enter on the keyboard, it runs the calculete_somehing method in the master page.

Why does that happen?

How can you associate a button event click with the enter key press?

NotMe
  • 86,296
  • 27
  • 170
  • 243
user1958628
  • 399
  • 4
  • 6
  • 18

1 Answers1

0

This code can handle enter keypress on page:

$(document).keypress(function(e) {
  if(e.which == 13) {
   // enter pressed and u can call click function
    $('.calculete_somehing').click();
   }
});
Mennan
  • 4,279
  • 12
  • 51
  • 85