I am trying to make a simple validation on some agreements by checking an asp:checkbox and clicking an asp:button.
On my Button I am calling this:
OnClientClick="ValidateConditions();"
And the function runs by this:
function ValidateConditions() {
if ($('#ChkAccept').is(':checked')) {
alert("Checked");
args.IsValid = true;
}
else {
alert('Nope it is not checked');
args.IsValid = false;
}
}
It works so far, but how do I stop running my button method when args.IsValid = false; ? Right now it shows the message and runs the method in both cases.
It must be a simple thing that I need.. Best regards.