0
I am developing an application in ASP.NET MVC 5 and I have a problem in putting a charging modal while the form is saved, because when there is something invalid in the form javascript does not respect, showing the charging modal, I would like to know how to take the dynamic Modelstate to release the modal only when it is true, thus avoiding to show the modal mistakenly.
I’m trying to use this way unsuccessfully:
$('#salvar').click(function () {
var isValid = ${ViewData.ModelState.IsValid};
if (!isValid) {
waitingDialog.hide();
} else {
waitingDialog.show('Salvando Chamado...');
}
});
Which plug-ins are you using to validate the form on the front end? Unobtrusive Jquery?
– Vinícius
@Vinicius, I am using the standard of ASP.NET MVC 5 Microsoftmvcvalidation.js
– Anderson Souza