I know, with jQuery, it is possible to check a checkbox, but us it possible to submit a form. Not handle the submission / submitted data, but simulate the submit button being clicked— or if possible the enter / return key being pressed?
4 Answers
Of course but you need to specify an even at which you want to simulate the action . I suppose that you want it to be the press of enter key .. the code will be
$(document).keypress(function(e){ if (e.which == 13){ $("#submit").trigger('click'); } }); $("#submit").click(function(){ // do your stuff })