简体   繁体   中英

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?

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!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM