php and Javascript
am 06.01.2008 11:28:41 von KenI am trying to run two form.submit() in sequence when clicking on
image... ..."try this"
When calling send() with only invoice.submit active, the form invoice works
correctly.
When calling send() with only setTimeout("transfer.submit()", 10000), the
form transfer works correctly.
When both are active, the php script runs and sends an email but the
transfer.submit does not work.
Data is entered in invoice and forwarded in transfer.
I left out some script to simplify the posting.
Suggestions would be appreciated. I have spent the entire day trying
different things with no success.
Thanks.
(Javascript)
function send() {
invoice.submit();
setTimeout("transfer.submit()", 10000);
}
I thought it was a timing problem so I added a time delay which did not
solve the problem. Without the delay, the script has the same problem.
(Javascript)
function calculateinvoice() {
transfer.first_name.value = invoice.f_name.value;
}
invoice.submit calls a php script which emails the data.
First Name: | align="left"> |
I cannot use type=submit in invoice.submit().
emailc.php
error_reporting(E_ALL);
//error_reporting(0);
$date = date('F j, Y');
$fname = $_POST['f_name'];
$message = "$date \n\n $fname";
$to = emailname@domainname.com;
$subject = "$fname , $date";
mail($to, $subject, $message);
?>
method="post">
value="Try this" onclick="send()">