Hello,
I am using Sharepoint 2010 and have a document library. The document library comes with an Upload.aspx rather than a NewForm.aspx like lists do. It appears that I cannot create a custom Upload.aspx page like I can with the Display and Edit forms. That's fine. I tried just to add my javascript code in the Upload.aspx file (by editing the file in advanced mode in Sharepoint Designer). I added my javascript in the same manner that I do in all my List custom forms as well as my EditForm.aspx for my document library, meaning I start with the area:
<asp:Content ContentPlaceHolderId="PlaceHolderTitleAreaClass" runat="server">
<script type="text/javascript" id="onetidPageTitleAreaFrameScript">
if (document.getElementById("onetidPageTitleAreaFrame") != null) {
document.getElementById("onetidPageTitleAreaFrame").className="ms-areaseparator";
}
</script>
and I add my javascript inside that script tag with something like:
function myFunction() {
alert("I am here");
}
_spBodyOnLoadFunctionNames.push("myFunction");
This function never gets called when I click on the "Add document" link to upload a new document to my document library. I also just tried to add an alert in the script tag but not in a function and that isn't getting called. Not sure what I am missing because this works in all the other custom and non-custom forms that I use.
Any thoughts? - Peter