I'm using a UIWebView to load an HTML form in my iPhone app.
The form has three submit buttons (and selecting "Go" on the iPhone keypad selects the first submit button).
I'm assuming that I can set a different "default" submit button with Javascript injection into the downloaded form, but I don't know Javascript well.
Does anyone know how to change the default submit button ?
I've just hit this problem, and am now using the following pair of techniques;
Firstly, most browsers use the "first" submit button found on the form, and as I want my default action to be "Send", I add the following immediately after the tag:
It's not displayed, but still used as a submit button when hitting enter - except on the iPhone for some reason - possibly webkit decides that the hidden submit button should be ignored, as it's hidden. For these browsers, I simply do the following;
i.e. when the users clicks on the input field, it changes the name of the default button to the action that I want; when I click out of the field, it returns to the original.