Working on forms with web-to-lead

Using web-to-lead is an easy way to generate HTML code that you can drop into your website to create a lead capture form. A lead capture form is generated outside of Salesforce but creates a lead directly in Salesforce when the form is saved. This can take the form of a Contact Us page on your website or any other form where you would want the information to be automatically added to Salesforce. Let's see how this is done:

  1. Click on the gear at the top of the page (see label 1 in the following screenshot) and choose Setup (see label 2 in the following screenshot):

Clicking on Setup in the preceding screenshot brings you to the administration section of Salesforce.

  1. Next, type web in the quick-find box (see label 1 in the following screenshot). This will bring up Web-to-Lead. Click on the link (see label 2 in the following screenshot), as in the following screenshot:

  1. Clicking on Web-to-Lead brings you to the Web-to-Lead settings page. On this page, click on Create Web-to-Lead Form:

  1. This brings you to the web-to-lead creation section. There are a few options on the next page to be filled in before you generate the code:
    • Available Fields: These are all of the fields available on the leads object. You can pull any of them into your form.
    • Selected Fields: These are the fields that are included in the form once you generate the HTML code.
    • Return URL: This is where the user lands after submitting the form.
    • Include reCAPTCHA in HTML: This is optional—you can add a reCAPTCHA to the form.

After this, click on Generate. The following screenshot shows the preceding steps:

  1. Clicking on Generate is the final step that will generate the HTML code for you. Now, you have your HTML code! You can copy and paste this right into your website and start capturing leads:

The preceding screenshot shows the final output.

You have now learned how to navigate to the web-to-lead setup section and how to generate the HTML code needed to add a web-to-lead form to an external website. Next, let's take a look at setting up auto-response rules to support web-to-lead submissions.