I have created a validation with two checkbox.
both validations are working fine with javascript
let me show you my code
javascipt
function Validation_agree(){
if(document.form1.agreed1.checked==false)
{
$(".agreement_main").show();
return false
}else{
$(".agreement_main").hide();
}
if(document.form1.agreed2.checked==false)
{
$(".agreement_terms").show();
return false
}else{
$(".agreement_terms").hide();
}
}
form is like
<div class="checkme">
<label><input type="checkbox" value="" name="agreed1" />I have discussed all of the order details above and the customer is happy to proceed</label>
<br />
<div class="alert agreement_main" style="display:none;">Please confirm you have informed the customer of the T&Cs</div>
</div>
<div class="redNote">
<label><input type="checkbox" value="" name="agreed2" />I have informed the customer where they can find the T&C’s on the BT.com website</label></p>
<div class="alert agreement_terms" style="display:none;">Please confirm you have informed the customer of the T&Cs</div>
</div>
<input type="submit" value="submit order" /></div>
</form>
the problem is that. one is working after vadating other one
When press submit button shows first validation error message. I would like to make both validation check at a time
any one help me please
thanks in advance
Below code may work for you.