Checkbox warning

i have a form with questions with a yes or no answer. Obviousley they have to answer each question either yes or no. Is it possible to flag a warning if they dont select either saying “please choose yes or no” ?

Thanks.

You could simply make it a requirement in HTML - Here’s an example

<form action="/submit" method="post">
    <label for="terms">I agree to the terms and conditions:</label>
    <input type="checkbox" id="terms" name="terms" required>
    <br>
    <input type="submit" value="Submit">
</form>

Though with yes or no you probably will need a little JavaScript?

After reevaluating, I’ve come to the conclusion that using an HTML Radio element might be a more aesthetically pleasing choice. Additionally, it offers the advantage of setting a default option.

brilliant thank you very nice looking.

Sponsor our Newsletter | Privacy Policy | Terms of Service