Can I use a select dropdown like I can a checkbox with perch if statemenets

  • I'm using a perch if statement to add a class to a span depending upon which checkbox is selected.

    Problem is I have 19 potential colours that can be selected so checkboxes are not the best option for my users.

    Is there anyway I can have like a select dropdown box where depending upon what's selected will add that class to the span class.


    Here's my code


  • I think you should be using a select for this. When you specify the options you can separate a display text and value with |. So a perch select with options=“Option 1|opt1,Option 2|opt2” Will display Option 1 for the user in the CMS but the value rendered in the HTML will be opt1.


    its ideal for specifying classes with language friendly names for the CMS users