This is hopefully an easy one for those amongst you that are js guru's.
So here is the scenario;
I have a very simple form which contains a couple of text fields and a single button.
When the button is pressed, I want three things to happen;
1 The form data is submitted.
2 The form is reset.
3 A hidden link is "clicked"
So, I created (copied from internet) the following function;
The function is called when the button is clicked.
The situation is that the submit and the reset works fine across the board, the ".click()" works in IE and throws an error in FF.
Can anyone offer a solution please?
So here is the scenario;
I have a very simple form which contains a couple of text fields and a single button.
When the button is pressed, I want three things to happen;
1 The form data is submitted.
2 The form is reset.
3 A hidden link is "clicked"
So, I created (copied from internet) the following function;
HTML:
<script type="text/javascript">
function submit_form()
{
document.form1.submit();
document.form1.reset();
document.getElementById("mb2").click();
}
</script>
The function is called when the button is clicked.
HTML:
<input name="Button" type="button" class="submit1" id="submit1" onclick="submit_form()" value="Submit" />
The situation is that the submit and the reset works fine across the board, the ".click()" works in IE and throws an error in FF.
Can anyone offer a solution please?