While I was writing some code to print out JS when a field is not valid in the ModelState
is came to the following method:
ModelState.IsValidField(string key)
The comment in IntelliSense tells me:
Returns true if there is any System.Web.Mvc.ModelError associated or prefixed with the specific key.
While I ask whether a field is valid it will return false
in case it is not valid and true
if it is valid.
This seems quite illogical, yet I haven't found any resource on the web that confirms this.