Sharepoint - CSRListForm and PreSaveAction or PreSaveItem
The problem you were having is because you weren't using the standard save button. The standard save button looks kind of like this:
<input name="somereallylongname" value="Save"
onclick="if (!PreSaveItem()) return false;if (SPClientForms.ClientFormManager.SubmitClientForm('WPQ2')) return false;//etc"
id="somereallylongname"
target="_self" type="button">
Notice that the onclick
event starts with if(!PreSaveItem()) return false;
, and then it does if (SPClientForms.ClientFormManager.SubmitClientForm('WPQ2')) return false;
. You said you're doing:
SPClientForms.ClientFormManager.SubmitClientForm('WPQ2');
to save the form, but that's only a portion of the logic, removing much of the validation. If you had done:
if (!PreSaveItem())
return false;
if (SPClientForms.ClientFormManager.SubmitClientForm('WPQ2'))
return false;
from your own button, validation would have worked the way you expected, including PreSaveItem. All OOB forms in 2016 are CSR forms, and they still work fine with PreSaveItem/PreSaveAction.