Choice generated dynamically does not support multiple
SOLVE
I am trying to create a choice module, that has some options generated dinamically. After creating it, I want to have the possibility to multiple select choices from this, similarly how a choice field works on modules when "Allow selection of multiple options" is activated. Code: {% choice "multi_choice_field" label="multiple choice" display="select" choices=[ [ "option-1", "Option 1" ], [ "option-2", "Option 2" ] ] multiple=true %} Is this possible? Thanks in advance
We’ve shared some code with you, including different conditions. Please check it once—hopefully, it will work. If not, kindly share the page with us, and we’ll take a look and provide guidance.
If you prefer to keep the dropdown style but allow multiple selections, you’ll need to manually adjust the HTML using the select tag and enable multiple selections like this:
<select name="multi_choice_field" multiple> {% for option in options %} <option value="{{ option.value }}">{{ option.label }}</option> {% endfor %} </select>
I hope this will help you out. Please mark it as Solution Accepted and upvote to help another Community member. Thanks!
Choice generated dynamically does not support multiple
SOLVE
Hello @GRajput Thanks for following up. I have tried this approach earlier and it doesn't work. I do not think that what I am trying to do is possible, after confronting official Hubspot Documentation. On the choice tag, the only parameters that could be added are value and choices, and this means that this dynamically generated choice module doesn't behave like the usual choice field on modules. Thanks for reaching out
We’ve shared some code with you, including different conditions. Please check it once—hopefully, it will work. If not, kindly share the page with us, and we’ll take a look and provide guidance.
If you prefer to keep the dropdown style but allow multiple selections, you’ll need to manually adjust the HTML using the select tag and enable multiple selections like this:
<select name="multi_choice_field" multiple> {% for option in options %} <option value="{{ option.value }}">{{ option.label }}</option> {% endfor %} </select>
I hope this will help you out. Please mark it as Solution Accepted and upvote to help another Community member. Thanks!