AnswerBun.com

Add link to button in infopath

SharePoint Asked by J.Choe on January 4, 2022

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?

One Answer

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.

Answered by harshal gite on January 4, 2022

Add your own answers!

Related Questions

sharepoint application deployment error

1  Asked on December 19, 2021 by faisaljanjua

 

How to create content fields and use in new page layout.?

1  Asked on December 17, 2021 by abhijeet-pawar

     

Ask a Question

Get help from others!

© 2023 AnswerBun.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP