I'm using jquery (unobtrusive) validation for MVC, and I have a field that is not a part of my model, so I'd rather not add it JUST to give it some data annotations.
And, all I need is to ensure that the value is equal to 100 ... I'd like this validated along with everything else.
I read this article: http://www.blinkingcaret.com/2016/03/23/manually-use-mvc-client-side-validation/
And, I added
data-val="true"
As well as
data-val-equalto="100"
But this didn't work.
<input type="text" name="smtotal" id="SMTotal" class="form-control " readonly="readonly" data-val="true" data-val-equalto="100"/>
<span class="field-validation-valid" data-valmsg-for="smtotal" data-valmsg-replace="true">This must equal 100</span>