none
Adding javascript to my NewForm.aspx page

    Question

  • Hi, I am trying to add the following to my form in order to provide a link for the user to open my infopath xml document.  This works on a regular content editor web part but I keep receiving javascrip errors when I try to do it in my new form.

    //added this part beneath my <<SharePoint:ListFormPageTitle runat="server"/> tag

    <script type="text/javascript">
         function NewRequest()
         {
      
            createNewDocumentWithRedirect('https:\u002f\u002fdol.xxx.com\u002fsites\u002fdddddcom\u002fProdOps\u002fvendormgmt\u002fVendor Mgmt Requests\u002fForms\u002ftemplate.xsn', 'https:\u002f\u002fdol.xxx.com\u002fsites\u002fdddddcom\u002fProdOps\u002fvendormgmt\u002fVendor Mgmt Requests', 'SharePoint.OpenXmlDocuments.2', true, 'https://dol.xxx.com/sites/dddddcom/ProdOps/vendormgmt/_layouts/FormServer.aspx?XsnLocation=https://dol.xxx.com/sites/dddddcom/ProdOps/vendormgmt/Vendor%20Mgmt%20Requests/Forms/template.xsn', 0)
         }
     </script>

    //added this part beneath my webPartZone

     <tr>
     <td>
     <A title="" href="javascript:NewRequest();" target="">Click here to initiate a new Vendor Requests</A>
     </td>
     </tr>

    The error is the listed below


    Webpage error details

    User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.2; MS-RTC LM 8; .NET4.0C)
    Timestamp: Thu, 17 Feb 2011 17:57:30 UTC


    Message: Object expected
    Line: 1
    Char: 1
    Code: 0
    URI: http://domainandthenFLists%2FProject%2520Request%2520Form%2FAllItems%2Easpx

    Any help or advice appreciated.


    Leland Usher SharePoint Developer/Administrator
    • Edited by Leland Usher Thursday, February 24, 2011 4:53 PM
    Thursday, February 17, 2011 6:20 PM

Answers

All replies