Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I make it so that you cannot click "GO" to submit the form (iPhone), but must tap the "submit" button?

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?

like image 553
TIMEX Avatar asked Oct 11 '22 15:10

TIMEX


1 Answers

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());
});
like image 110
TNC Avatar answered Oct 19 '22 22:10

TNC