FireFox: strange behavior on submiting a form

Posted by ilnur777 on Stack Overflow See other posts from Stack Overflow or by ilnur777
Published on 2010-05-21T17:59:55Z Indexed on 2010/05/21 18:10 UTC
Read the original article Hit count: 193

Filed under:
|
|

Can anyone help with this strange form submiting in FireFox?

So this form should be submitted after pushing "go to submit" button. There is an onclick event on the button that should submit form through JavaScript. In the form there is another button "test" without any onclick event. Following the script, the form should be submitted only after pushing the "go to submit" button, but it submits even pushing at "test" button.

In the Internet Explorer it works well! But this stupid FireFox browser behaves different.

Here is example of HTML page:

<script>
function func(){
document.form1.submit();
}
</script>

<form name="form1" method="post" action="somewhere.php">
<button>test</button>
<input type="button" value="go to submit" onclick="func();">
</form>

I have several buttons with <button onclick="...">option 1</button> options. I want to fix strange submiting a form in FireFox. Help please!

© Stack Overflow or respective owner

Related posts about firefox

Related posts about form