0

I am using the jQuery Validation Engine in Asp.net MVC everything working for me however when i trying to use in Asp.net Button Validation Messages is come but also the form submited. how to disable the submiting if form is not valid.

<link href="~/Content/validationEngine.jquery.css" rel="stylesheet"/>
<script src="~/Scripts/jquery.validationEngine-en.js"></script>
<script src="~/Scripts/jquery.validationEngine.js"></script>
<script type="text/javascript">
        $("#form5").validationEngine({ ajaxFormValidation: true, promptPosition: "bottomLeft", scroll: true, maxErrorsPerField: 1 });
</script>
1
  • Show me your asp submit button code, in order to help you...i know how to do this Commented Apr 23, 2015 at 18:55

1 Answer 1

1

It should be done in this way:

$("#<%:yourAspButton.ClientID%>").click(function(e){
   e.preventDefault();
   if($('#form5').validationEngine('validate'))
   {
     $("#form5").submit();
   }
});
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.