Getting iPhone GO button to submit form

So, here was our specific issue:

We had a form with multiple user input fields, but not a true <input type="submit"> (it was being submitted via JS).

As such, the GO button did nothing.

We then added an <input type="submit"> and set it to display: none hoping that would do the trick. Nope. Didn’t work.

On a whim, we changed display: none to margin-left: -1000px

That worked!

Apparently, Safari is looking for the presence of a SUBMIT button in the form and only if it’s not display: none, it will then fire it when you hit the GO button.

Leave a Comment