How to change the default InfoPath Url form server for a form library in SharePoint
By default, MOSS directs browser-based InfoPath forms to the /_layouts/formserver.aspx page with query string parameters that define the form to display or edit. We have defined our own page (for a number of reasons) and would like to route the forms to the form library. The page can be placed in the same _layouts folder in the document library, it doesn't really matter.
It looks like there should be a link (hopefully in a configuration setting form) that tells SharePoint where to send forms.
Thank!
+2
source to share
2 answers
If you are using SharePoint lists or form libraries to display a list of forms, you can add jquery rewrite (either in the custom editor web part or master page) to find links to the FormServer.aspx link.
<script type="text/javascript" src="~/_layouts/jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
//Rewrite Form Links to Open in Custom Page
$("a[href*='/_layouts/FormServer.aspx']").each(function()
{
var formFileName = this.href.figureOutWhatFormAndParamsYouNeed()
var formServerUrl = 'https://server.example.com/_layouts/CustomPage.aspx'
this.href = formServerUrl
});
})
</script>
+2
source to share