Skip to content Skip to sidebar Skip to footer

Popup Not Returning Values In Form With Errors

I am using ASP.NET Core 2.1, C#, MVC. I have a modal popup and when I submit the form with ajax not showing the errors of the model (required fields etc) on the same popup window,

Solution 1:

I was missing 2 JS references files from the page because I didn't added layout.

<scriptsrc="~/lib/jquery-validation/dist/jquery.validate.js"></script><scriptsrc="~/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.js"></script>

Also if you want to take the Model of the form you can do it with

var data = JSON.stringify( $(form).serializeArray() );

Post a Comment for "Popup Not Returning Values In Form With Errors"