Reputation: 1242
I'm new to Android Phonegap. I'm using Phonegap cordova 3.3.0 to develop phonegap application. But I don't know how to trigger "enter" event on Android keyboard.
For example: when I touch on Input field, the keyboard appear, and I want to submit the form when press "Enter/go" button. Please tell me how to do it, or give me the reference link?
Thanks very much!
Upvotes: 2
Views: 1815
Reputation: 14315
Try this
$(document).keypress(function(e) {
if(e.which == 13) {
alert('You pressed enter!');
}
});
Upvotes: 4