0

Within an InfoPath 2013 form on my SharePoint-Site (2013 on-prem) I would like to include a button, which directs (onclick) to an external URL.

I am pretty new to InfoPath and did not find yet any material on board for solving this requirement.

I need a solution without using SharePoint-Designer, as this tool is strictly prohibited in my company.

0

I have solved my demand with following workaround:

1) I created a button in InfoPath (with no rule on)

2) On SharePoint, I checked with the dev-tools of Webbrowser (F12) the ID of the rendered button:

enter image description here

3) On this site, where the form is displayed, I added a Script-Editor with the following Code (containing the specific ID of the button):

<script>
$('document').ready(function(){ 
document.getElementById("ctl00_SPWebPartManager1_g_00d4f4ae_096b_445e_8be6_35b5be425a03_FormControl0_V1_I1_PB7").onclick = function() {
    window.location.replace("https://stackoverflow.com"); 
    }
});
</script>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.