Reputation: 63
I have a web page with a form and multiple submit buttons, each that do something different (clear form, perform a calculation, add another entry line, etc).
ONLY on iPhone (tested on both 5 and 5s, both Opera and Chrome, so not browser specific) when the user enters text into a text box and presses the "Go" button built into the native iPhone keyboard, a generic pop-up comes up that just says:
http://myurl
error
I've set the calculation button as the default action on form submission and the following jQuery is triggered when the iPhone's "Go" button is pressed (equivalent to pressing Enter on keyboard):
var buttonKeys = { "EnterKey": 13 };
$(function () {
$("input[name*=ItemValue]").keypress(function (e) {
if (e.which == buttonKeys.EnterKey) {
var formValid = $('form').validate().form();
if (!formValid) { this.focus(); return false; }
var defaultButtonId = $('form').attr("defaultbutton");
$("#" + defaultButtonId).click();
return false;
}
});
});
When you click ok on the prompt, then the postback occurs, and the default functionality is triggered. Nothing looks incorrect, and all else happens as expected. I've stepped through the jQuery that's being used after the button is pressed, and everything seems to be triggering normally but this error keeps popping up.
Any thoughts on what might be happening here, or even suggestions on how to troubleshoot this error?
In all other browsers and devices this does not happen. The error only appears on iPhone.
Upvotes: 0
Views: 177
Reputation: 63
In case anyone has the same issue, I was able to solve this by updating from jquery 1.9.1 to 2.1.0 for the mobile version of the site only (2.1.0 does not support IE8, so I didn't do it globally).
The error ended up coming from the library itself, and appears to be a bug that was fixed in the later version.
Upvotes: 1