Skip to content

Rule doesn't work for checkbox #1395

Discussion options

You must be logged in to vote

Hi @JulieVelghe,

It seems that you're rendering the field container manually. I would advise not doing that, but instead pass in your classes to the container manually.

So instead of this:

<div class="c-form__field c-form__field--options" data-field-container="{{ field.handle }}">

do this:

{{ field.renderContainerOpeningTag({ 
  attributes: { 
    class: "c-form__field c-form__field--options" 
  } 
}) }}

   <!-- ... your code here --> 

{{ field.renderContainerClosingTag }}

This lets you utilize the attribute editor in the builder, as well as make sure that you always get relevant attributes added to the field.

In this case you need a data-field-type="checkbox" attribute for your checkb…

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@JulieVelghe
Comment options

Answer selected by kjmartens
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #1345 on July 03, 2024 05:48.