【发布时间】:2013-06-29 10:00:15
【问题描述】:
我正在尝试使用 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 做到这一点?
【问题讨论】:
标签: jquery html validation parsley.js