andrewf
06-17-2005, 03:31 PM
Hello,
I have an HTML form where visitors fill out their
Name: ________
Phone:________
Email: _________
And they have the option of browsing their computer for a file, and then uploading the file to my server.
The problem is I have 2 different actions and I want just 1 Button to perform both...
The first action sends the info they provided including their "name, phone, email and the name of the file they uploaded (not the actual file, just the name of it) to me via email.
That action looks like this: action="<?= $PHP_SELF ?>"
The second action is used to upload the file to my server.
It looks like this: action="uploadresults.php"
I can get the submit button to perform either one of the actions... but I can't get it to do both... And I really need just 1 button to do both.
What I would really like is for the first action (the one that sends off the email to me) to happen in the current browser window. And the second action (the one that uploads the file) to happen in a new pop up window...
So the result when you click the button would be that the page basically refreshes and shows my message saying "Thank you your message has been sent" And a second window opens that says "Your file has been uploaded."
I have been searching all over Google and it seems as though you can't really have two actions with just one submit button... But there has to be a way using JavaScript or something to perform both actions.
Any help or direction would be great!
Thanks, Andrew
I have an HTML form where visitors fill out their
Name: ________
Phone:________
Email: _________
And they have the option of browsing their computer for a file, and then uploading the file to my server.
The problem is I have 2 different actions and I want just 1 Button to perform both...
The first action sends the info they provided including their "name, phone, email and the name of the file they uploaded (not the actual file, just the name of it) to me via email.
That action looks like this: action="<?= $PHP_SELF ?>"
The second action is used to upload the file to my server.
It looks like this: action="uploadresults.php"
I can get the submit button to perform either one of the actions... but I can't get it to do both... And I really need just 1 button to do both.
What I would really like is for the first action (the one that sends off the email to me) to happen in the current browser window. And the second action (the one that uploads the file) to happen in a new pop up window...
So the result when you click the button would be that the page basically refreshes and shows my message saying "Thank you your message has been sent" And a second window opens that says "Your file has been uploaded."
I have been searching all over Google and it seems as though you can't really have two actions with just one submit button... But there has to be a way using JavaScript or something to perform both actions.
Any help or direction would be great!
Thanks, Andrew