I have the following input:
<input class="text-box single-line hasDatepicker valid" id="RiskInputModel_Filters_StartDate" name="RiskInputModel.Filters.StartDate" type="text" value="1/1/0001 12:00:00 AM"><br>
<span class="field-validation-valid" data-valmsg-for="RiskInputModel.Filters.StartDate.Value" data-valmsg-replace="true"></span>
and after a bit of ajaxy goodness I want to do the following:
var validator = $("form").validate();
var obj = { };
obj[responseText.message.fieldName] = responseText.message.errorText;
validator.showErrors(obj);
where responseText.message.fieldName is RiskInputModel.Filters.StartDate
I have tried with RiskInputModel_Filters_StartDate
but neither actually does anything?
as well as appening .Value or _Value to the end respectively
am i missing something obvious here?
UPDATE
if i run this in the console:
$('form').validate().showErrors({"RiskInputModel.Filters.StartDate" : "Start date must be less than or equal to End date."});
it doesn't error - so must be finding the element to validate with - but does nothing with it?