jeudi 9 juillet 2020

3 state checkbox required=true but checked and unchecked are valid. Intermediate should be invalid

I have this 3 state checkbox:

<div>
    <input required type="checkbox" id="effectiveness" name="effectiveness">
</div> 

and at the beginning the value is set to intermediate with jquery like this:

$("#effectiveness").prop("indeterminate", true);

the required attribute checks if the attribute checked is true. But i want checked="true" and checked="false" to be valid. The only unvalid state should be indeterminate. How can i archieve this?




Aucun commentaire:

Enregistrer un commentaire