Here is a tip for anyone setting up web-to-lead pages using SalesForce. SalesForce for those of you who don’t know is a world class CRM solution and the ability to generate and integrate web-to-lead functionality into your website or land pages gives you a lot of additional functionality after you get your lead data into SalesForce.
If you happen to be testing a web-to-lead page generated in your Sandbox currently you may notice that you are having issues when you save it as an HTML file locally and test it further as you develop validation for it, passing other hidden values and things of that nature. No leads are showing up in your Sandbox as you test is the most common one and if you are new to working with HTML, web pages and web-to-lead forms then this tip could be pretty valuable for you.
Step 1: Log into SalesForce and go to Setup | Customize | Leads | Web-to-Lead and generate your web to lead form
Step 2: Copy and Paste the code into an HTML editor and edit following lines of code…
<form action=”https://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8” method=”POST”>
and change the ‘www’ to the instance that you sandbox is running on. So if you have a Sandbox running on CS4 it would look like this:
<form action=”https://CS4.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8” method=”POST”>
Lastly locate the oid value and set it to the value of your sandbox instance of SalesForce.
<input type=hidden name=”oid” value=”00Dxxxxxxxxxxxx“>
Step 3: Save the HTML file containing the Web-to-Lead form and use knowing that the leads generated will appear in your sandbox now.
Best Practice: Save the web-to-lead form locally on your PC if you want to edit and make changes to it as SalesForce doesn’t currently store web-to-lead functionality in SalesForce.
I hope that you found that brief tutorial on how to modify the web-to-lead code in order to test it in a sandbox before using it in production.