I have a couple of forms that are misbehaving in FireFox, but work fine in IE.
when i do submit( with submit button) a javascript function validates all of the fields entered, and stops the submission if there is an error.
Sample (obviously not working code):
[HTML] <html>
<head>
<script type="text/javascript">
function Submit()
{
// do something, like form field validation before submitting
return true;
} else {
return false; // do nothing, do not submit the form
}
}
</script>
</head>
<body>
<form name="myForm" action="form.cg i" onSubmit="retur n Submit()>
Some form fields here<br/>
<input type="submit" value="Submit" >
</form>
</body>
</html>
[/HTML]
THE PROBLEM:
In IE, the script performs as expected.
In FireFox (tested in v2.0.0.3):
* if the form validates correctly, it gets submitted twice:
* if the form doesn't validate then nothing happen.
Am I coding something wrong here? Why is FireFox submitting the form two times..
when i do submit( with submit button) a javascript function validates all of the fields entered, and stops the submission if there is an error.
Sample (obviously not working code):
[HTML] <html>
<head>
<script type="text/javascript">
function Submit()
{
// do something, like form field validation before submitting
return true;
} else {
return false; // do nothing, do not submit the form
}
}
</script>
</head>
<body>
<form name="myForm" action="form.cg i" onSubmit="retur n Submit()>
Some form fields here<br/>
<input type="submit" value="Submit" >
</form>
</body>
</html>
[/HTML]
THE PROBLEM:
In IE, the script performs as expected.
In FireFox (tested in v2.0.0.3):
* if the form validates correctly, it gets submitted twice:
* if the form doesn't validate then nothing happen.
Am I coding something wrong here? Why is FireFox submitting the form two times..
Comment