R
Rick
I have a form that calls a perl script. A few javascript routines in
the form do a few things prior to submitting. For some reason,
however, the perl script is being called twice (the perl script sends
out an email, and submitting the form once results in two identical
emails.)
Here are excerpts from the script that I believe to be relevant (I can
post more if this isn't enough, but it's long and I'm trying to keep
it brief.) Can anyone tell me what I'm doing wrong? I've read about
how you need to return true after calling the javascript via a button
click, but I've done this kind of thing in other places and it's
worked fine. I've also tried inserting a return statement here in the
function and it doesn't seem to make a difference. Strange. (BTW, I
changed the domain name in the URL out of courtesy to my client, just
FYI.)
---------
<script language="javascript">
function sendFormNow(theForm)
{
toggleVis ('sendbutton');
toggleVis ('progressbar');
theForm.submit();
}
[...]
<form action="http://cgi.mysitedomain.com/cgi-bin/alertmail.cgi"
method="post">
[...]
<input type="submit" value="send" onClick="sendFormNow(this.form);">
[...]
</form>
the form do a few things prior to submitting. For some reason,
however, the perl script is being called twice (the perl script sends
out an email, and submitting the form once results in two identical
emails.)
Here are excerpts from the script that I believe to be relevant (I can
post more if this isn't enough, but it's long and I'm trying to keep
it brief.) Can anyone tell me what I'm doing wrong? I've read about
how you need to return true after calling the javascript via a button
click, but I've done this kind of thing in other places and it's
worked fine. I've also tried inserting a return statement here in the
function and it doesn't seem to make a difference. Strange. (BTW, I
changed the domain name in the URL out of courtesy to my client, just
FYI.)
---------
<script language="javascript">
function sendFormNow(theForm)
{
toggleVis ('sendbutton');
toggleVis ('progressbar');
theForm.submit();
}
[...]
<form action="http://cgi.mysitedomain.com/cgi-bin/alertmail.cgi"
method="post">
[...]
<input type="submit" value="send" onClick="sendFormNow(this.form);">
[...]
</form>