Checkboxes with value

Hi,

I’m makgina form with some checkboxes, generaly when I’m using pure HTML I can make something like this for a checkbox group:

<span>
   <input class="checkbox" type="checkbox" name="247[]" value="Co-working">
   <span></span>
   <span class="text-form-black">Co-working</span>        
</span>
						
<span>
   <input class="checkbox" type="checkbox" name="247[]" value="Home Office">
   <span></span>
   <span class="text-form-black">Home Office</span>        
</span>

So each checkbox is in one group and gives me back a string value, not a bolean onw (true or false).

There is a way do make something similar to this?

Thanks

1 Like

Hi Vitor!

When using checkboxes in a WF form, give the input a name and an ID, possibly the same - and when the form is submitted, you see it with the name attribute and if it is checked or not in the email or table in the project settings.

image

So the name attr works more or less the same as an value attr!

Hey,

I don’t see how this would work. For instance the code I shown will give me a table with a collum named “247” and its lines will have what I’ve cheked, if I check more than one item it’ll show “Co-working, Home Office”

By giving an name and an ID it’ll be the same. I’ll have 2 collums one for Co-working and one for Home-Office, with its lines saying true or false if they have been cheked or not.

PS: Btw great name

Ah a man of culture, I see!

Have you build your form and tested?
I have created a test form with a text input, email input and a checkbox.

The checkbox only has the ID and name set.

image

Make sure you set in on the checkbox element itself and not the parent of it (see highlighted element)

image

The submitted form will look like this in the project settings:

WF collects the inputs and bundles them up, as you can see.

1 Like

The picture you put here makes my point.

Look how there is a collum named “office” with its value being “true”. If you put another check box field you’ll name it, for instance, “home”. The table in the project settings will have a new collum named “home” with tis value true or false.

I whis to have a tablem with a collum named “Place to work” and its value being waht the user selected. Like so:

image

Well, you could use a select element to achieve that, with allowed multiple selection…

But the default behavior leaves room for improvement in terms of UX.

Maybe you could just try to work with more than one column in the results…

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.