Reputation: 1564
I am working in an MVC application. In my app, I have mvc property validations using data annotations. Also I have some client side validations for some fields. I need to fire both validations together while submit button click.
Currently only client side validation firing first and return false. After valid inputs,then mvc validation works.
Please help
Upvotes: 1
Views: 651
Reputation: 1564
I have used client side validation in "Submit" event of form. So Client side validations and server side data annotations working together.
Upvotes: 0
Reputation: 504
Usually client side validation is used to not send bad data to server. In the same time it repeats server side validation. Server side validation reasons:
The main rule of using validation is cutting off bad data, that cannot be used. Summary: use client side validation combining with server side. If data is passed through client validation, call appropriate methods on the server side. In this scenario you can cover most of the cases.
Upvotes: 1