Detect if asp.net mvc2 client side check or pass

That's it ... I'm working on an asp.net mvc2 project using MicrosoftMvcValidation ...

I have custom javascript that I need to run when the form submits ... At the moment, I run this code when I click the submit button. However, when client-side validation fails, I do not want to run the code.

I see this article about connecting to a scan, but I can’t get it to work. ASP.NET MVC2 - connect to client-side validation

Does anyone have any tips on how to achieve the following.

When the submit button is pressed and the client check passes ... run my custom code
When the submit button is clicked and the client check fails ... do not run your code

+3
source share
2 answers

u can use jquery like $ ('# your_form_Id'). valid () this checks if the form is valid and will return true if it is valid or returns false.

See the documentation here: http://docs.jquery.com/Plugins/Validation/valid .

+1
source

jQuery . , ,

0

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


All Articles