I am working on SharePoint office 365 (2016), and facing issue while adding custom validation in new item form.
Here scenario is complex, I can't handle by using Validation setting/formula. So I have choose custom JavaScript code.
As validation should be perform on click of Save button and PreSaveAction method successfully called but only in 'Classic Experience' but when user changed to 'New Experience' it won't call because of change of HTML structure of the form.
Does any one have an idea how to fix this issue? Thanks in advance!


Modern (New) Experiences do not allow any custom scripting, branding or modifications.

Cast your vote here to tell Microsoft they made a mistake:



Try using PreSaveItem function. It is called when onClick event handler is fired for Save button in List Forms.

PreSaveItem function:

function PreSaveItem()
   if ("function"==typeof(PreSaveAction))
      return PreSaveAction();
   return true;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.