html - Submit button doesn't work on enter -
i have several "submit" inputs on form (this caused framework i'm using), control button activated on "enter" (as "go" button of android keyboard), have added markup:
<input type="submit" style="position:absolute;top:0;left:-100px;" onclick="$('#defaultbutton').click();return false;" />
i'm placing in beginning, it's first in order, still inside of form. works great in 1 of applications, not working @ in other!
even more suprising in other application, there case when there 1 single submit, should working default without additional work, never worked. when add hidden submit - doesn't work neither. have checked via javascript count of submits on page - , have shown me 2: 1 one visible user, other 1 i'm adding.
ok, did javascript handle keypress, it's working, don't aproach - prefer natural way, when first submit acts default button.
also, have checked on mobile - thought there problem "go" button not work - working. it's not working in desktop browser only.
what can problem here? submit missing attribute?
i can't post whole page, cause it's huge, here simplified markup of "real" submit button (it generated framework):
<input onclick="*ajax javascript*; return false;" type="submit" name="defaultbutton" value="continue" id="defaultbutton" tabindex="17" class="button" />
here form tag (also generated framework):
<form method="post" action="signup.aspx" onsubmit="javascript:return webform_onsubmit();" id="webform1" name="webform1">
update. i'd note again, made working via handling onkeypress keycode == 13, wondering why normal submit button doesn't react on enter, should.
try instead:
$('#defaultbutton').trigger("click");
remove javascript:
onsubmit
:
onsubmit="return webform_onsubmit();"
Comments
Post a Comment