Not showing confirmation dialog when data annatation errors
I've simple MVC View for employee registration and when user click on "Create Employee" button, I’m displaying Jquery c开发者_开发问答onfirmation dialog.
How can I stop showing confirmation dialog when MVC View has Data Annotation errors.
Thanks, -Naren
Its basically the same as defined here
How to fire jQuery function only if form is valid
check if the form is valid:
$(function () { $('#yourForm').submit(function () { if($(this).valid()) { //call dialog } else { //not valid } }); });
精彩评论