0

With the Salesforce web-to-lead option, there is a return url that happens when form has been submitted. However it is static. But I would like info passed along from the form such as an email they provided. Is there a way to do this?

My scenario would be to use this in Wordpress and when the form is submitted, redirect the user to a thank you page and then send them an email/do some other tasks.

1 Answer 1

1

It's normal HTML--you can manipulate the URL with JavaScript. Technically, this is outside the scope of this site, but as a simple example:

 <input name="email" onchange="updateRetURL(this)" />

 <script>
 function updateRetURL(input) {
   document.getElementById("retURL").value = 'https://my.wordpress.com/page?email='+input.value;
 }
 </script>

Note that if the user disables JavaScript, this won't work--and there's no way to make it work. The Web-to-Lead interface is rather minimal, so the only other alternative would be to host your own script on your site, then submit the Web-to-Lead data to the W2L endpoint, then redirect. You can do this in PHP, Perl, Ruby, or whatever other language your server supports.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .