Webflow sync, pageviews & more.
NEW
Answers

Can I disable email submission for a form on Webflow? I have multiple forms on my site and want to prevent one specific form from sending emails, as it is a zip code submission that redirects to an external booking page.

Yes, you can disable email submission for a specific form on Webflow.

To do this, follow these steps:

1. Open your Webflow project and navigate to the page where the form is located.
2. Double-click on the form element to open its settings.
3. In the Form Settings panel on the right, click on the "Action" field.
4. By default, the action attribute is set to "Webflow" which indicates that the form submissions will be sent to your Webflow project. Change this to "Custom" by selecting it from the dropdown menu.
5. Once you select "Custom", an additional input field will appear below called "Custom attribute." In this field, you can enter any value you want, but for our purpose, let's say you enter "disableEmailSubmission".
6. Save your changes.

Now that you have set a custom attribute for the form, you'll need to add some custom code to prevent the form from sending emails.

1. Go to your Webflow project settings by clicking on the gear icon in the left sidebar.
2. In the Project Settings, click on the Custom Code tab.
3. In the Head Code section, add the following code:

```

```

This JavaScript code selects all the forms on your website with the custom attribute we set earlier and prevents their default submission behavior. You can modify the code inside the `form.addEventListener('submit', function(e) { ... })` function to add any additional logic or behavior you need. For example, you can redirect the user to an external booking page using `window.location.href` or perform any other desired action.

Save your changes, and that's it! The form with the custom attribute will no longer send email submissions, and it will redirect your users to the external booking page as desired.

Rate this answer

Other Webflow Questions