# Email Input Field Trigger













<Tip>
  This feature requires paid tier of framer!
</Tip>

## 1. Create Surface Constructor [#1-create-surface-constructor]

1. In Framer, go to project `settings`.
2. Scroll down to `Custom Code` section.
   <Frame>
     <img className="block" src="/images/framer/pop-slide/1.png" />
   </Frame>
   Add the following code in the `End of <body> tag` section.

Modify the Surface Form Embedding Script to include the `data-question-id` attribute.

<Note>
  You must replace the &#x2A;*`<question_id>`*&#x2A; within &#x2A;*`data-question-id`** attribute below with the question ID from the Surface Form Builder.
</Note>

<Frame>
  <img alt="Question ID Location" src="__img0" />
</Frame>

```html
<!-- 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 -->
```

## 2. Add the Form Component [#2-add-the-form-component]

1. In Framer, click on &#x2A;*`insert`** to add new component inside the website.
2. Select &#x2A;*`Form Builder`** from the list of components.

<Frame>
  <img alt="Form Component" src="__img1" />
</Frame>

## 3. Create new code override for the form component [#3-create-new-code-override-for-the-form-component]

<Frame>
  <img alt="Form Component" src="__img2" />
</Frame>

1. In the form component, click on &#x2A;*`properties`** to open the properties panel.
2. Scroll down to &#x2A;*`Code Overrides`** section.
3. Click on &#x2A;*`New File`** to create a new file.
4. Name the file as &#x2A;*`SurfaceFormHandler`**.
5. Click on &#x2A;*`Create`** to create the file.

## 4. Modify the Surface Form Embedding Script [#4-modify-the-surface-form-embedding-script]

In the `SurfaceFormHandler` file, add the following code:

<Frame>
  <img alt="Form Component" src="__img3" />
</Frame>

```tsx
export function withClass(Component): ComponentType {
    return (props) => {
        props.className += " surface-form-handler" // Remember to add a space
        return <Component {...props} />
    }
}
```

## 5. Apply the code override to the form component [#5-apply-the-code-override-to-the-form-component]

<Frame>
  <img alt="Form Component" src="__img4" />
</Frame>

1. In the form component, click on &#x2A;*`properties`** to open the properties panel.
2. Scroll down to &#x2A;*`Code Overrides`** section.
3. Select &#x2A;*`SurfaceFormHandler`** from the list of files.
4. Select &#x2A;*`withClass`** from the list of overrides.
5. Click on &#x2A;*`Apply`** to apply the code override.
