---
schema_version: "1"
id: 31608a3883c6a390191835997908cab09a035506c17982341615446ce7f29128
title: Generate and Test Your Web-to-Case Form
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/service/264-0-0/web_to_case_html.md
canonical_url: https://help.salesforce.com/s/articleView?id=service.web_to_case_html.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 7d91c18c23f0145cd0188c23482497946d5459fc080b93ee5ab222a5efd66305
description: Generate HTML code that can be inserted into your company's website to capture cases in a web form. Whenever someone submits information using the form, a case is created.
products:
  - Service Cloud
  - Digital Engagement
release: "264"
---
# Generate and Test Your Web-to-Case Form

Generate HTML code that can be inserted into your company's website to capture cases in a web form. Whenever someone submits information using the form, a case is created.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col style="width:100%"></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;"><a href="https://help.salesforce.com/s/articleView?id=service.web_to_case_editions.htm&amp;release=264.0.0&amp;type=5" title="Learn about the Salesforce editions and user interfaces that support Web-to-Case.">View supported editions</a>.</td></tr></tbody></table>

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small permission">
        <colgroup>
          <col style="width:50%">
          <col style="width:50%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="colgroup" class="slds-cell-wrap" colspan="2" style="vertical-align:top;" id="d100333e64">User Permissions Needed</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d100333e64 ">To set up Web-to-Case:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d100333e64 ">Customize Application</td>

          </tr>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d100333e64 ">To generate Web-to-Case HTML</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d100333e64 ">Customize Application</td>

          </tr>
        </tbody>
      </table>

1. Complete the steps in [Prepare for Web-to-Case](https://help.salesforce.com/s/articleView?id=service.setting_up_web-to-case_prereqs.htm&release=264.0.0&type=5 "Before setting up your web form with Web-to-Case, complete these steps.") and [Turn On and Customize Web-to-Case](https://help.salesforce.com/s/articleView?id=service.setting_up_web-to-case.htm&release=264.0.0&type=5 "Gather customer support requests directly from your company’s website and automatically generate new cases with Web-to-Case. To set up Web-to-Case, enable the feature, create and customize your web form, and add the form to your website.").
2. From Setup, enter Web-to-Case HTML Generator in the Quick Find box, then select **Web-to-Case HTML Generator**.
3. Select the fields to include on your Web-to-Case form.
4. If your organization has a self-service portal and you want web-generated cases to be visible to portal users, select **Visible in Self-Service Portal**.
5. Specify the complete URL to which customers are directed after they submit their information. For example, the URL can be for a “thank you” page or your company's home page.
6. If **Require ReCAPTCHA Verification** is selected on the Web-to-Case page in Setup, complete the reCAPTCHA fields. If you select that option after having already generated the HTML code, generate the code again to ensure that it includes the reCAPTCHA validation code.
    1. Leave **Include reCAPTCHA in HTML** selected.
    2. Enter the key pair that you obtained from Google and registered on the Salesforce Platform. Use the lookup to select a key pair that is already registered on the Salesforce Platform.
    3. Leave **Enable Server Fallback** selected to prevent the loss of case traffic. If the Google reCAPTCHA server fails or goes offline and spam filtering isn’t available, this setting allows all case traffic through.
7. If your organization uses the Translation Workbench or has renamed tabs, select the language for the form labels displayed on your Web-to-Case form. The source of your Web-to-Case form is always in your personal language.
8. Click **Generate**.
9. Copy the generated HTML code and embed it into any page on your website. You can add it to multiple pages on your site.
10. Click **Finished**.

To test the Web-to-Case form, add the line `<input type="hidden" name="debug" value="1">` to the code. This line redirects you to a debugging page when you submit the form. Don’t forget to remove it before publishing the Web-to-Case page on your website.

#### See Also

- [Turn On and Customize Web-to-Case](https://help.salesforce.com/s/articleView?id=service.setting_up_web-to-case.htm&release=264.0.0&type=5 "Gather customer support requests directly from your company’s website and automatically generate new cases with Web-to-Case. To set up Web-to-Case, enable the feature, create and customize your web form, and add the form to your website.")
- [Prevent Spam Cases with reCAPTCHA](https://help.salesforce.com/s/articleView?id=service.customizesupport_web_to_case_enable_recaptcha.htm&release=264.0.0&type=5 "We recommend adding reCAPTCHA v2 to your Web-to-Case web form to prevent spambots from wasting service reps’ time and muddying your case data. The reCAPTCHA widget requires customers to select an “I’m not a robot” checkbox before they can create a case.")