how to validate if a checkbox is checked in javascript