Forum Moderators: open
<input type="button" onClick="someAction();" value="Submit">
Is this (close to) correct?
Input type="button" has no inherent action without JS; even if you are using a submit button and have your actions assigned to it, those actions won't execute on enter key press. Give this a try:
<form method="post" action="yourscript.cgi" onSubmit="return someAction();">
....
<input type="submit" value="Submit">
</form>
And be absolutely sure to return false at the end of "someAction":
function someAction() {
....
return false;
}
This last bit is what stops the form from submitting via natural events and allows your Javascript to manage the submission.
Your second suggestion of including return false; stopped this discrepancy however.
Strange that this would happen but I'm glad it's fixed now, thanks.