문제

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:

https://sharepoint.uservoice.com/forums/329214-sites-and-collaboration/suggestions/13385364-allow-javascript-customization-and-css-branding-th

다른 팁

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;
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 sharepoint.stackexchange
scroll top