HOW-TO: create Checkboxes dynamically?

Hi.
I need to create dynamically a number of Checkboxes on a page, like for RadioButtonGroup.
I have a function which returns an array or options which user can checkmack.
How to do that?
For RadioButtonGroup I can assign property “options” from script and that works fine. But it looks like there is no such possibility for Checkbox. :-\

Note: this is a dynamic page called “vote”, I want to give user possibility to vote for certain question. And he should be able to checkmark checkboxes to tell - “I’m voting on behalf of … option A, option D, option N, etc”

Could you please advice how to do that? I would like to implement voting by one page without re-doing multiple votes for each option.

Hey
You can’t, that is the simple answer. As Wix Code don’t allow you to use form elements inside repeaters you cannot repeat any of those elements.

What you will have to do is to create an iframe with those inside and when clicked report back to Wix Code which one was clicked.

OR…

Mimick a checkbox with two images and add those to a repater and when clicked switch image. I use this approach in some projects.

1 Like