Condition to automatically select the option of a checkbox?