MVC ClientSide Validation Events

Does anyone know if there is an event that fired successfully with client-side validation and how I will use it.

I enabled it, but I need to run some script onSuccess.

 <% Html.EnableClientValidation(); %>

Thanks in advance.

+3
source share
1 answer

You can use jquery and attach the function to the form submit

$("form").submit(function(event){
 //You can use event.preventDefault() to stop the form from submitting on it own
 if($(this).valid())
  { //Do something } 
 else 
  {  } 
};

http://api.jquery.com/submit/

0
source

Source: https://habr.com/ru/post/1775872/


All Articles