I'm having some issues trying to find the best course of action to block a form submission from going through if the answer to a yes/no question or at least give an error message properly.
First attempt was simply adding required="true" to the "No" button:
<th valign="top" align="left">
<label for="yesOrNo">
<strong>Are you a bad guy?</strong>
<br />
<br />
</label>
</th>
<td valign="top">
<label>
<input type="radio" name="yesOrNo" id="yesOrNo" value="yes" />Yes</label>
<br />
<label>
<input type="radio" name="yesOrNo" id="yesOrNo" required="true" value="no" />No</label>
<br />
<br />
</td>
</tr>
Then after that didn't work fully with "yes" still being valid for submission I tried making a hidden field that's required through angular which worked for me in the past. Granted this worked for a text field and numbers, I took an estimate on what to use in the case of a yes-no radio button:
<th valign="top" align="left">
<div ng-if="angularYesOrNo=true">You are uneligible for this promotion</div>
<label for="yesOrNo"><strong>Are you a bad guy?</strong>
<br />
<br />
</label>
</th>
<td valign="top">
<label>
<input type="radio" name="yesOrNo" ng-model="angularYesOrNo" id="yesOrNo" value="yes" />Yes</label>
<br />
<label>
<input type="radio" name="yesOrNo" id="yesOrNo" value="no" />No</label>
<input type="hidden" name="badGuyFlag" id="badGuyFlag" ng-required='angularYesOrNo=true' />
<br />
<br />
</td>
</tr>
Is there anything in either code that I would need to change to make this work? Or is there any functions I would need to add in a separate script tag? This has been racking my brain all afternoon.