Is anyone aware of what variables go into a form to make the iPhones virtual keyboard\'s GO button submit the form vs. not?
I\'ve been trying to narrow down the scen
The code given by the others is correct. If you are using jQuery Mobile then add
data-role="none"
to the submit input element. Like so:
<input type="submit" data-role="none" style="visibility: hidden; position: absolute;" />
As of writing (11/19/2019), on iOS 13.1.3, the following scenarios change the return
key label:
INPUT
element must be wrapped in a FORM
element, and the FORM
element must have an action
attribute. (It can be an empty string, i.e. action=""
.)INPUT
element has a type
of search
, the return key have a label of search
.type
attribute will result in the return key having a label of go
.The presence of an INPUT
or BUTTON
element with a type
set to submit
does not appear to affect the return key label. (Though it's a good idea to include one for accessibility purposes.)
I could not work out why a very simple google maps form was not submitting using the iPhone Go button.
Turns out, after stripping it down, it does not work with target="_blank"
on the form tag.
Removed that, and now the Go button works on iPhone.
Here's a JSFiddle to try it