mardi 14 avril 2015

SImulate "Enter pressing" when submit button is clicked

When my submit Button in the form is clicked, I need to simulate that the "Enter button" is pressed. so: clicking on the submit form is equal to pressing Enter on the keyboard. Because I want to have the same method for both...


Here is what I have, but until now it doesnt works..



$(document).on('click', '#send', function(){
$("#chatMessageTextarea").focus();
var e = jQuery.Event("keypress");
e.which = 13;
e.keyCode = 13;


});


Aucun commentaire:

Enregistrer un commentaire