1: var row = $(this).closest('tr');
2: var description = row.find('td:eq(1)').text();
3: var code = row.find('td:eq(0)').text();
1: var row = $(this).closest('tr');
2: var description = row.find('td:eq(1)').text();
3: var code = row.find('td:eq(0)').text();
While you can add the data-val attributes for MVC client side validation by default MVC unobtrusive validation won’t process them.
What you have to do is remove the validators and re-add them.
1: $("#Password").attr("data-val-required", "Password is required");
2: $("form").removeData("validator");
3: $("form").removeData("unobtrusiveValidation");
4: $.validator.unobtrusive.parse("form");