Good afternoon, I have a registration screen that I am making an ajax call to send the data, however when the user does not fill some field I need to show a field validation error message. In other sign-up screens on my system I used the @Html.ValidationMessageFor to report validation error however in that case it does not work since I am not doing the post inside the Html.BeginForm. Could anyone give me a hint of how I could display a validation error message in the default of Html.BeginForm without using Html.BeginForm?
$.ajax({
url: '/Teste/Save',
data: JSON.stringify(salesmain),
type: 'POST',
contentType: 'application/json;',
dataType: 'json',
autoUpload: true,
success: function (result) {
if (result.success) {
location.reload();
}
else
{
document.getElementById("btnsalvar").disabled = false;
}
}
});