I have a page where I would like a form to be completed , a javascript file verifies the information, sends the information to a php file to mail it to me and then initiates a download. The problem is that I can have the javascript file either send the mail or allow the file to be downloaded, but not both.
The code in question looks like this:
else {
document.dlform7.action = "http://www.myurl.com/c/post7.php" ;
document.dlform7.submit();
window.location.assign(url);
}
Is there a way (perhaps using load) that I can have both of these actions take place at once?
edit:
ajax option:
else {
$.ajax({
url: "http://www.myurl.com/c/post7.php";
type: "POST",
data: data,
cache: false,
success: function () {
window.location.assign(url);
document.dlform7.submit();
},