Forms with collections

Hello!

I got an interesting problem - on my site there is a collection of items, which I would like to insert in form, so my customers can check them via checkbox, and I will receive the form on my email with unique names of these items and true/false.

What have I done:

  • Created a form
  • Inserted several collection lists into it (for different categories)
  • Created checkboxes with my items

What is the problem:

  • if I try to fill the name for checkbox field, it applies to all the checkboxes in the collection list (unique for one category), and I get only one checkbox, instead of several
  • if I do not fill the name - I receive random checkboxes field numbers on my email, which I can’t identify

What can I do? How do I create a form with information from my CMS, and how do I set unique names for all the fields?

Thank you in advance!


Here is my public share link: https://preview.webflow.com/preview/melody-a7dce7?utm_source=melody-a7dce7&preview=35c04075a33531fd312ebc3b5a76a59c

Page with buggy form is named HERE IS THE BUG

2 Likes

You’re going to require custom code for this @Anastasia_N

To get you started you will need something like this in order to pull CMS elements value to a form:

In your form, insert an HTML Embed. It will simply be an input field with the value set to the CMS Field Value you wish to associate to the submission.

<input type="hidden" name="CMS-ITEM" value="{dynamic field from collection}">

type="hidden" would set it as not displayed but whose value is submitted to the server. type="text" would make it visible to the user.

6 Likes

Thank you for advice - it works quite well! I just needed to set type=“checkbox” and name=“{dynamic field}” :slight_smile:

However I got another question, considering form submissions - can I receive not all the checkbox fields, but only those with “true” responce?
Since I got around 50 checkboxes in my form, and it’s hard to find ones with “True” responce without using search :smiley: Is there any syntax to include only marked checkboxes in {{formData}}?

1 Like

One option is to add required for checkbox X. If this checkbox is not required - only by excel (Download CSV& Filter table). Or add example, more details.

Please mark @aaronocampo answer as solution (For future searches about this topic). Thanks :slight_smile:

Checkbox is not required, there are just lots of them (around 50) in my form, and I receive HUGE email submission, with all of them.


So there is only an option to download CSV and filter it, I got it :unamused:

How do you know what to put in the {???} variable?