/collection-name/slug
).To dynamically redirect users to a CMS item (collection page) after a form submission in Webflow, you need to combine Webflow form handling with custom JavaScript and either a unique field or reference selector.
article-title
, product123
) or another field that can be used to identify the desired item.slug
, project-id
, or similar.Use Webflow’s form submit event to intercept the form before default redirect behavior.
In your Webflow project, embed the following logic in a custom code block included on the same page as the form, or in Page Settings > Footer Code:
Example logic:
On successful form submit, extract the input value
Build the CMS URL based on the slug field
Redirect to that CMS item’s dynamic route (/collection-name/slug
)
Sample code (minified for clarity):
Important: Replace collection-name
with your actual Collection Page slug.
```javascript
```
Adjust name="slug"
to match the input’s name attribute or selector in your form.
To redirect dynamically to a CMS item after form submission in Webflow, use a form input that captures a unique identifier (like a slug), then apply custom JavaScript to redirect users to the correct CMS collection page using that value.