Use a single checkbox when you want a simple yes/no answer. This is recommended above using radio buttons with yes and no values.
The checkbox field is an input of type checkbox. The value attribute is usually output by the form processing script but is not seen by the user. The name attribute is used by the form processing script to label and identify the input text.
<input type="checkbox" name="q4" value="yes" />
To comply with accessibility guidelines, the field must be explicitly and uniquely identified and labeled, and to work with the template style sheets, some divs, spans and classes must be added.
<div class="boolean"> <span class="question">A boolean checkbox for simple on/off responses</span> <span class="answer"><label for="q4"><input type="checkbox" name="q4" id="q4" />boolean checkbox</label></span> </div>
To enable validation for this type of field you need to add the required class to the enclosing div and a span of class required-flag to the question span.
<div class="boolean required"> <span class="question">A boolean checkbox for simple on/off responses <span class="required-flag">(required)</span>:</span> <span class="answer"><label for="q4"><input type="checkbox" name="q4" id="q4" />boolean checkbox</label></span> </div>