Contact Us:

670 Lafayette Ave, Brooklyn,
NY 11216

+1 800 966 4564
+1 800 9667 4558

This is a question which I came across on the success community and which made me realise that it could be something which admins always look for an answer. Through this blog post I am going to give a simple solution which can even used by a Salesforce Admin who is not good with code. If you are a Salesforce Admin then you simple need to follow these steps.

  • Go to Web-to-Lead Setup and click Create Web-to-Lead Form button
  • Select the fields which you want see on the web form including State/Province and Country
  • Click the Generate button and add the following javascript code at the end of your generated code

 
https://gist.github.com/sfcure/aa4371d3e27f9f4162a78f9f9c78f347#file-web-to-lead-country-js

Sample Complete html file with Javascript code

 
https://gist.github.com/sfcure/aa4371d3e27f9f4162a78f9f9c78f347#file-web-to-lead-html
 

JSFiddle to the Web-to-lead form with state and country dependent pick list fields.
https://jsfiddle.net/h3v4msju/

I hope it helps!!

Leave a comment

Your email address will not be published. Required fields are marked *