Iphone keyboard "go" won't work jquery submit

I have a form on a page with a submit button. If I click the Submit button, it will send a JQuery POST to another page and register the user. Works great if I use the submit button on the page. If I hit "Go" on the numeric keypad, it just refreshes the page.

I assume this is because it is rendered like this (using iWebkit) ...

<span class="graytitle">Login</span>
<ul class="pageitem">
<form name="form" method="post" action="#">
<li class="form"><input placeholder="Username" type="text" id="login"/></li>
<li class="form"><input placeholder="Password" type="password" id="password"/></li></form>
<li class="form"><input type="submit"  onClick="SubmitForm('login')" ></submit></li>
</ul>

      

You will see that the view is outside of the form because in any browser the page just reloads. If I use a button and not submit, I get the same response.

Works great on safari desktop

Does anyone know why this is?

I tried onSubmit

0


a source to share


1 answer


I'm pretty sure the submit button should be inside the form - why would you need it outside?

Otherwise, when the user clicks Go, they submit the form rather than fire your JS onClick event (looks like they hit Return / Enter after they've finished typing the textbox).



Your Javascript is never called and nothing happens, except that the form is submitted to the location you specified in the "action" field ... in this case "#".

+2


a source







All Articles