Multiple fields validation using Remote Validation

Expanding on Jaluka’s answer, I wrote this helper method that finds each remotely validating element that has “additional fields,” and then causes validation on said element to fire each time one of those fields changes. // I hate naming things function initializeRemotelyValidatingElementsWithAdditionalFields($form) { var remotelyValidatingElements = $form.find(“[data-val-remote]”); $.each(remotelyValidatingElements, function (i, element) { var $element = … Read more

Remote Validation for LIST of MODELs

You have not posted your code for the model or controller, but assuming you have a RemoteAttribute applied to property Username, for example public class MyModel { [Remote(“IsValidUserName”, “Person”)] public string Username { get; set; } } with a method in PersonController public JsonResult IsValidUserName(string Username) { …. } and the view @model List<Person> … … Read more