sharepoint-2013infopath2010

Return to Top of Form in InfoPath


I found this SharePoint way to return to the top of the page here. Does anyone know of a way to integrate this into an InfoPath form that resides on SharePoint?


Solution

  • I found a limited work around using jQuery. I downloaded the .js file from here:

    jquery-3.1.0.slim.min.js

    Saved it to my SharePoint Site and then embedded the following to the Page housing the InfoPath web part.

    <script src="https://yoursharepointURL.com/SiteAssets/Scripts/jquery-3.1.0.slim.js"></script>
    
    <script type="text/javascript">
    function openLinkInSameWindow() {
    
     $('a[target="_blank"]').removeAttr('target'); 
    }
     _spBodyOnLoadFunctionNames.push("openLinkInSameWindow");
    
    </script>  
    

    Then in the InfoPath form I called the script using the following URL

    https://yoursharepointURL.com/SitePages/Page.aspx#top
    

    It's been working well since!