Not a bug Incorrect checked icon state

truonglv

Well-known member
Affected version
XF Latest
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.webp
 
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.
 
Top Bottom