我想用parsley.js验证单选按钮。以下是我正在尝试使用的代码使用parsley.js验证单选按钮
<p id="registration_field_custom2" class="onefield registration_field_custom2">
<span class="doyou">
<span class="text">etc etc etc etc ?</span>
<input type="radio" name="custom2" value="Yes" id="custom2_yes"
data-required="true"
data-error-container="#submitDetails .error6"
data-error-message ="Please chose either yes or no"
/>
<label for="custom2_yes">Yes</label>
<input type="radio" name="custom2" value="No" id="custom2_no"
/>
<label for="custom2_no">No</label>
</span>
</p>
但是,无论我选择是或否,它仍在查找两者都需要的数据。我只是希望用户能够选择是或否......如何使用parsley.js来做到这一点?
这应选择答案。感谢代码示例 – geedubb
这只适用于第一个单选按钮的父级的错误类... – Loenix