Check checkbox before clicking button

Akiii
Posted by Akiii under jQuery category on | Points: 40 | Views : 1821

<input id="chkTermsAndCondition" type="checkbox" /><br/><br/>
<asp:Button ID="btnCheckOut1" runat="server" Text="COMPLETE ORDER" OnClientClick="return CheckTerms();"/>



<script type="text/javascript">
function CheckTerms() {
if ($('#chkTermsAndCondition').is(':checked')) {
return true;
}
else {
alert("Please accept the terms and conditions !");
return false;
}
}
</script>



Thanks and Regards
Akiii

Comments or Responses

Login to post response