Sir
How to skip jquery validation on cancel button click
Reference to my linked question. The validation of jQuery plugin is working perfectly but I have a cancel button also on form. The cancel button is not closing form on click and going on validation (which is not required). Please help me how to skip validation on cancel button.
I have also used CausesValidation="false" and value=”save” but both are not working
Please guide
<script type="text/javascript">
$(function () {
$("#form1").validationEngine('attach', { promptPosition: "topRight" });
});
function DateFormat(field, rules, i, options) {
var regex = /^(0?[1-9]|[12][0-9]|3[01])[\/\-](0?[1-9]|1[012])[\/\-]\d{4}$/;
if (!regex.test(field.val())) {
return "Please enter date in dd/MM/yyyy format."
}
}
</script>
<asp:Button class="btn btn-primary" runat="server" Text="Back" OnClick="Cancel_click" CausesValidation="false" />