Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $('body').on('keyup', function(e) { //monitora por enter na pag
- if (e.which === 13) {
- e.preventDefault();
- }
- });
- $('form').on('keyup', function(e) { //monitora por enter no form.
- if (e.which === 13) {
- e.preventDefault();
- $(this + ' input[type=submit]').trigger('click'); //reza pra achar o formulario no 'this' e da um submit
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement