locked
Add custom JS for edtiform.aspx RRS feed

  • Question

  • Hi,

    I want to add custom JS in edit form.aspx. I have checked lots of example but that will not fulfill my requirement. Big constraint, I have use this custom JS for more than 1000 libraries. I can't edit all forms to add JS. I have added JS using CustomAction. this function works in other pages but not on editform.aspx.

    I want this for SP Online.

    Please suggest.


    Satyam MCITP, MCPD


    Sunday, July 26, 2015 6:10 AM

Answers

  • CustomAction is according to Microsoft the way to do this. Also see their example here:

    https://github.com/OfficeDev/PnP/tree/master/Samples/Core.EmbedJavaScript

    That it does not work in EditForm.aspx seems a bug to me. You could raise it there.
    Alternatively, you could add the JS reference to your masterpage. However, custom masterpages is advised against.


    Please remember to mark your question as answered & Vote helpful

    Monday, July 27, 2015 12:48 AM

All replies

  • CustomAction is according to Microsoft the way to do this. Also see their example here:

    https://github.com/OfficeDev/PnP/tree/master/Samples/Core.EmbedJavaScript

    That it does not work in EditForm.aspx seems a bug to me. You could raise it there.
    Alternatively, you could add the JS reference to your masterpage. However, custom masterpages is advised against.


    Please remember to mark your question as answered & Vote helpful

    Monday, July 27, 2015 12:48 AM
  • Actually, there is a way to put a custom code in editform.aspx, you just need to open the list using sharepoint designer and go to list folder, you can open the editForm.aspx there (if you have permission of course) and put your custom js code there.

    *hope i did more help in this matter. If you find this more an appropriate answer please vote. cheers!

    Monday, May 2, 2016 6:56 AM