Form field must contain data from a CMS Collection

Hi!

I’d need create a form that has a required field which only accepts certain numbers.
Those numbers would be the ones listed on a collection page.

If a client tries to submit the form, but the numbers doesn’t match in that one field, it won’t send the form and shows an error message.

To better explain:

  • I’d have CMS Collection list called e.g. “Customer identification numbers”
  • The collection has items called “111”, “112” and “113”
  • I’d have a form field called “Add your customer identification number”
  • If a client adds a number that matches (e.g. 111, 112 or 113), the form can be submitted
  • If a client adds a number that doesn’t exist in the collection list (e.g. 000), form can’t be submitted and it shows an error message

Anybody know wether this is possible to do in Webflow or with custom code?

I’d solve this by always allowing the form to be submitted, but capture that submission within Integromat/Make.

There, you can check the submitted value against the Webflow CMS item (via the Webflow API).

If the values do not match, redirect the user to an error page.

If the values do successfully match, then redirect the user to your success page (or where ever).