• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Not a bug Incorrect checked icon state

Affected version
XF Latest

truonglv

Formerly Nobita.Kun
#1
I have used the follow code block. With the default is_staff value false. But when i check the frontend page it's show checked state.
Code:
<xf:checkboxrow>
    <xf:option name="is_staff" checked="{$memberRole.is_staff}">{{ phrase('tl_groups_display_as_staff') }}</xf:option>
</xf:checkboxrow>

Screen Shot 2017-10-29 at 10.11.25 PM.png
 

Chris D

XenForo developer
Staff member
#2
The checked attribute in the HTML5 spec is a boolean property. If it exists, it's true. It's false if it doesn't exist.

You should be using the selected attribute in XF template syntax to evaluate conditions which will add the checked attribute only if the condition evaluates to true.