I've got a simple HTML/PHP form that people fill out, it sends an email to someone in our office with what they've entered and uploads a file to an FTP site. The <form> tag looks like this:
<form name="contact-form" method="post" action="sendemail.php">
We've recently started using Salesforce and have decided it would be nice to have the form automatically populate salesforce, which helpfully has the functionality to spit out some code for you to use. However it starts:
<form action="https://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8" method="POST">
We still want to receive the email, so is there a way to post to sendemail.php and the salesforce webtolead?
Thanks in advance!
-
1I would suggest using AJAX. You can call sendmail.php with the specified data. When sendmail.php returns a success you can submit the form. (All in jQuery)Peter– Peter2015年10月06日 12:40:18 +00:00Commented Oct 6, 2015 at 12:40
1 Answer 1
You can't have 2 forms for the same fields. What you can do is you can submit to sendmail.php, and then in sendmail.php you can use curl (there are many examples on curl) to submit to the salesforce website. Not that hard at all to implement.