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
  • 87,343
  • 27
  • 171
  • 245
user1958628
  • 409
  • 4
  • 7
  • 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,451
  • 13
  • 54
  • 86