In my program, the frontend is created using Primefaces. When creating the registration form, I put a checkbox, which is the acceptance of the terms of service. I would like the checkbox to turn red when clicking "Register" if this checkbox is not checked.
<p:selectBooleanCheckbox immediate="true" id="checkbox"
value="#{backingBean.isChecked}"
style="#{backingBean.isChecked ? 'background-color:red':'background-color:white'}">
</p:selectBooleanCheckbox>
In my baking bean, I have a private field isChecked that stores a boolean.
My first problem is that when I put in 'style' properties " background-color, the color changes also the area around the checkbox, not the border itself. Border-color also does not work.
My second problem is that when I click "Register", the checkbox does not change color.