Reputation: 271764
I have a couple fields in a form.
On the iphone, when people are filling out their stuff, there is a "GO" button on the keyboard. Accidentally click this will submit the form
How can I use JQuery to return false whenever the "GO" button is pushed, but instead only submit the form when the "submit" button is clicked?
Upvotes: 5
Views: 450
Reputation: 4146
Instead of changing the behaviour that your users expect to be there, how about you just add some validation to the form so it can't be submitted unless the proper fields have been filled out?
Upvotes: 0
Reputation: 19782
I'm not sure this is something you should try to do - it'll just be an arbitrary difference between your form and other web forms, and will frustrate some users. I couldn't find anything in the Apple documentation, so I suspect there's no way to do what you want.
Upvotes: 2
Reputation: 5386
You can remove the action
tag from your <form>
and then submit your form in your tap action.
Something like:
$('#submit').tap(function() {
$.post('formsubmit_url.html', $("#formID").serialize());
});
Upvotes: 2