MaKSiNG
Technical User
- Dec 4, 2003
- 19
Hi All,
I am trying to submit data that I have collected in a form to an eMail.
To do this I am using an image button:
My form is defined as follows:
In my function submitForm I am simply doing:
The function is called because the confirmation box is launched and the 'else' operation is successful. However, the 'document.frmFlexible.submit();' doesn't seem to be executed. Is this the wrong syntax for some reason.
I have also tried mistyping 'submit' in the function above and this does not error, so it seems it is ignoring this statement completely.
If I simply do:
This button does exactly what I want it to.
Please help.
Thx,
MaKS
I am trying to submit data that I have collected in a form to an eMail.
To do this I am using an image button:
Code:
<img src="[URL unfurl="true"]http://myimage.gif"[/URL] name=btnSubmit id="btnSubmit" alt="Click here to submit feedback" style="CURSOR: hand" onClick="submitForm();" />
My form is defined as follows:
Code:
<form name="frmFlexible" id="frmFlexible" method="post" enctype="text/plain" action="mailto:myemail@mail.com" onSubmit="return submitForm();">
In my function submitForm I am simply doing:
Code:
function submitForm() {
if (confirm("Are you sure you want to submit this information?")){
return true;
document.frmFlexible.submit();
}
else {
alert ("Operation Cancelled.");
return false;
}
}
The function is called because the confirmation box is launched and the 'else' operation is successful. However, the 'document.frmFlexible.submit();' doesn't seem to be executed. Is this the wrong syntax for some reason.
I have also tried mistyping 'submit' in the function above and this does not error, so it seems it is ignoring this statement completely.
If I simply do:
Code:
<input type="submit" name="btnSubmit" id="btnSubmit">
This button does exactly what I want it to.
Please help.
Thx,
MaKS