AI OnAI Off
Think I just answered my own question. In web.config under appSettings add:
<add key="ClientValidationEnabled" value="true" />
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
Seems to work! Hopefully won't break Edit mode.
If you are worried that your settings in web.config might interfere with EPiServer UI, you could remove these settings on specific paths:
For example
<location path="EPiServer">
<appSettings>
<remove key="ClientValidationEnabled" />
</appSettings>
</location>
Anyone know if there is a recommended way to do client-side validation for a form presented to a non-edit-mode user? Also not using XForms...
I've been trying to get the classic MVC unobtrusive validation to work but the HTML coming from Html.EditorFor(m => m.FieldName) does not spit out the correct annotations needed by those libraries (data-val, data-val-required, etc). I assume Episerver has removed those so that it doesn't interfere with Editor-mode validation. Does anyone know how to turn that back on without having to write out the attributes manually?
Using the latest version of Episerver 7.1. Here's an example of my view & controller:
Many thanks,
Ryan