Normally, you should not rewrite submission to achieve this. You must decorate your view model properties with the appropriate validation attributes. For instance:
[Required] public string Foo { get; set; }
Then the HTML helpers generate the correct markup. But if for some strange reason you cannot change this code, you can use javascript to add these attributes manually:
$(function() { $('#id_of_the_field').attr('data-val-required', 'true'); });
After adding these attributes, you need to revise the form validation rules containing these input fields so that your changes take effect:
$('form').removeData('validator'); $('form').removeData('unobtrusiveValidation'); $.validator.unobtrusive.parse('body');
source share