我有一个带有这样标记的表单......
你剪了哪张优惠券
<div class="answer item1">
<input type="checkbox" name="downloaded_vouchers[answer1]" id="answer1" value="1"/>
<label for="answer1">Answer 1</label>
</div>
<div class="answer item1">
<input type="checkbox" name="downloaded_vouchers[answer1]" id="answer1" value="1"/>
<label for="answer1">Answer 1</label>
</div>
你用的是哪个代金券
<div class="answer item1">
<input type="checkbox" name="used_vouchers[answer1]" id="usedanswer1" value="1"/>
<label for="answer1">Answer 1</label>
</div>
<div class="answer item1">
<input type="checkbox" name="used_vouchers[answer1]" id="usedanswer1" value="1"/>
<label for="answer1">Answer 1</label>
</div>
我需要能够以某种方式在提交表单时检查凭证削减是否与使用的凭证匹配,有一些验证服务器端,但我也需要做一些客户端,不知道从哪里开始,我需要直接使用javascript没有jquery或类似的,有人可以帮忙吗?