PDA

View Full Version : Form won't submit


pathogen
11-11-2002, 04:59 PM
Hey,

I have a button that when clicked, offers the choice to continue or cancel. If continue is chosen, a form should be submitted, however, internet explorer is throwing this error at me:

Object doesn't support this property or method.

Here is the code in question:


function releaseMail(frm, rec, send, sub) {
if (confirm("Are you sure you want to release the following message?\n\nTo: " + rec + "\n\nFrom: " + send + "\n\nSubject: " + sub)) {
frm.submit();
}
}



<form name="708" method="POST" action="main.php">
<input type="hidden" name="release" value="708">
<input type="button" name="submit" value="Release" onClick="releaseMail(this.form, 'to@address.com', 'from@address.com', 'Some silly subject')">
</form>



Any ideas?

Thanks

requestcode
11-11-2002, 06:11 PM
It might be because you have given your button the name "submit". Try changing it to something else and see if it corrects your problem. Good Luck

Carl
11-11-2002, 06:36 PM
Try this,

function releaseMail(frm, rec, send, sub) {
if (confirm("Are you sure you want to release the following message?\n\nTo: " + rec + "\n\nFrom: " + send + "\n\nSubject: " + sub)) {
return true;
}
else {
return false;
}
}



<form name="708" method="POST" action="main.php">
<input type="hidden" name="release" value="708">
<input type="button" name="submit" value="Release" onClick="releaseMail(this.form, 'to@address.com', 'from@address.com', 'Some silly subject')">
</form>

beetle
11-11-2002, 06:43 PM
This would work too<form name="708" method="POST" action="main.php" onSubmit="return confirm('Are you sure you want to release the following message?\n\nTo: to@address.com\n\nFrom: from@address.com\n\nSubject: Some silly subject')">
<input type="hidden" name="release" value="708">
<input type="submit" value="Release">
</form>