The remote validation for the hidden field in mvc does not get fired Model :
[Remote("checker", "mycontroller", ErrorMessage = "Valid combination of phone and account number required.", HttpMethod = "Get")]
public string Validate_cart { get; set; }
View :
@Html.HiddenFor(model => model.Validate_Paris)
Also tried setting value by using jquery :
$("#Phone_Number").blur(function () {
$("#Validate_cart").val = "dummy"
});
using jquery or by model the value is set but validations do not get fired. I checked using fiddler there is no call for the method being made anytime.
Method
[HttpGet]
public bool checker(string Validate_cart )
{
try
{
bool isValid = //code to hit database to check the record
return !isValid;
}
catch (Exception)
{
throw;
}
}