Is there a way to add a button in infopath that contains a hyperlink. I would like to press a button that follows some rules and then takes you to a url.
If this is not possible, do you have any ideas for a work around?
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It only takes a minute to sign up.
Sign up to join this communityIs there a way to add a button in infopath that contains a hyperlink. I would like to press a button that follows some rules and then takes you to a url.
If this is not possible, do you have any ideas for a work around?
There is no way to Redirect a "Submit button" but to add script on the page. You can do this using Designer.
Find the ID of your button and add the following code:
<script>
function setEventHandler()
{
var btnSubmit = document.getElementById("ctl00_Something");
btnSubmit.onmouseup = function(){Button.OnClick(this, event); window.location='http://www.google.com';};
}
</script>
Call this function in your pageLoad or you can write the code inside your pageLoad function.
Here, onmouseup will call default method of Info Path for closing the form and then the even will be binded.
Try it and let me know if it works. I haven't tried it.