I have this iOS app that should submit a form via Ajax, which works for the most part. The only thing that does not work is that the GO button on the keyboard does not respond.
In a desktop browser, everything works for sending (submit button or key input)
Safari iOS works fine (submit button, GO GO button)
But when using it as a web application on iOS, the GO button does not work!
What can cause this behavior? As far as I know, the iOS web app still uses Safari ... :)
<form id="myForm" name="form" action="link-to-script.php" method="post">
<table>
<tr>
<td><input id="name" name="name" type="text" size="20" maxlength="25" /></td>
</tr>
<tr>
<td><input id="email" name="email" type="text" size="20" maxlength="50" /></td>
</tr>
<tr>
<td><input type="submit" name="Submit" value="Send" /></td>
</tr>
</table>
$('#myForm').submit(function(e) {
e.preventDefault();
var dataString = $(this).serialize();
$.ajax({
type: "POST",
url: "http://link-to-script.php?",
cache: false,
data: dataString,
success: function() {
}
});
});
UPDATE (SOLVED): I deleted again preventDefault(). This was not a bottleneck, but I don't like the unnecessary code. :)
When I added return false;the bottom of mine $('#myForm').submit(function() {, everything worked the way I wanted.
iOS GO, "Enter" "" .