0
votes

I modified the newform of a SharePoint 2013 list to include a custom JavaScript block. The script block was added just before the closing tag of the below asp content block.

 <asp:Content ContentPlaceHolderId="PlaceHolderMain" runat="server"> 
 </asp:Content>

When the page is rendered after clicking on the new item, the JavaScript block does not show up. What's strange is that it does work in one of the SharePoint sites but does not work in the other site. I also considered testing it with an another list in the same SharePoint site and it didn't work whereas it worked with any list in the other SharePoint site. Has anyone encountered this problem?

2

2 Answers

1
votes

Next time try to put into:

<asp:Content ContentPlaceHolderId="PlaceHolderAdditionalPageHead" runat="server">

</asp:Content>

Just add a <script> tag inside and paste your code. You can also add scripts in the same place.

0
votes

As a workaround, i used a content editor webpart within the newform aspx page and then added the javascript code in the content editor webpart and this worked.