I have almost completed an ASP.NET webforms website using jQuery Mobile. I am stuck on one specific use case.
The site is scoped to support Android, iPhone, BlackBerry and Windows Mobile all of the functionality works great except for one specific use case.
The case is when a user is entering a value into one of the input boxes and then hits the native Go/Enter key. I am capturing this and throwing the appropriate event submit button click/tap with jquery.
function BindSubmit(textbox, button) {
$(textbox).unbind().keypress(function (event) {
var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
if (keyCode == 13) {
$(button).trigger('tap');
}
});
}
This works great on all devices but one, Android. The phone ends up submitting the entire form instead of following the use case. Grabbing the onsubmit event and returning false doesn't work either. After some digging I found this Disabling 'go' button form submission in Android when using webview .
I am hoping for a solution to this for a standard webform. Thanks.