Menu

Input field

1. Add form block component

  1. In Webflow, click on Add Element to add a new element.
  2. Select Form Block from the list of elements.

2. Configure form block component

  1. In the form block component, Select Form from the list of elements.
  2. On the right side, under Style Selector, add the surface-form-handler class to the form.

3. Prefill other fields (optional)

If you want to prefill fields other than the email input, you can do so by adding custom attributes to your Webflow form fields.

Identity info fields

For identity-related fields (except email), add a custom attribute to the input field in Webflow:

  1. Select the input field in Webflow
  2. Go to Settings in the right sidebar
  3. Scroll to the bottom and click Add Custom Attribute
  4. Set the attribute:
    • Key: data-field-name
    • Value: One of the supported field names below
Supported Identity Field Values
Field NameDescription
firstNameFirst name
lastNameLast name
emailAddressEmail address
phoneNumberPhone number
companyNameCompany name
numberOfEmployeesNumber of employees
websiteUrlWebsite URL
titleJob title
streetAddressStreet address
aptSuiteEtcApartment/Suite/etc.
cityCity
stateState
countryCountry
zipCodeZip/Postal code
companyRevenueCompany revenue

Other form fields

For all other fields (non-identity fields), you'll need to use the question ID from your Surface form:

  1. Get the Question ID from the Surface Form Builder

  2. In Webflow, select the input field

  3. Go to Settings in the right sidebar

  4. Scroll to the bottom and click Add Custom Attribute

  5. Set the attribute:

    • Key: data-question-id
    • Value: The component ID from Surface

4. Surface form constructor

Go to the Webflow [dashboard](https://webflow.com/dashboard) > Project Section > Select Custom Code and add the following custom code into the footer code section.

Add the data-question-id attribute to your Surface form script.

<!-- Start Surface Form Embed -->

<script data-question-id="<question_id>">
  (function () {
     const surface_src = "surface_form_url";
     const surface_embed_type = "slideover"; // works on all embedding types!
     const target_element_class = "surface-form-button";
     const c = new SurfaceEmbed(
       surface_src,
       surface_embed_type,
       target_element_class,
     );
   })();
</script>

<!-- End Surface Form Embed -->