I have a form with markup like this….
Which voucher did you cut out
<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>
Which voucher did you use
<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>
I need to be able to somehow, on submition of the form check that the voucher cut matches the one that was used, there is some validation server side but I need to do some client side as well and have no idea where to start, I need to use straight javascript no jquery or similar, can anyone help?
something like this….
returning true from the onsubmit method will send the form through, returning false will not