How to trigger the enter keypress
var e = $.Event( "keyup", { keyCode: 13 } );
$('#yourInput').trigger(e);
Worked for me, instead of 'which', I used 'keyCode'
You can do this -
var e = $.Event( "keypress", { which: 13 } );
$('#yourInput').trigger(e);
- http://api.jquery.com/category/events/event-object/
- http://api.jquery.com/trigger/