LuluSW Posted August 26, 2017 Report Share Posted August 26, 2017 Hi I need to add a button that will redirect to a specific page on a HTML form This button must be visible or not visible based on a condition from an authentication field I created the html form and added this code: <script> if("[@authfield:User_Role]" == "Manager") { ---> Add a code here that will show a button that will redirect to a page } </script> Can someone send me an example code that I can place between the brackets? I tried several options but nothing works. Quote Link to comment Share on other sites More sharing options...
Mathilda Posted August 29, 2017 Report Share Posted August 29, 2017 On 8/26/2017 at 3:40 AM, LuluSW said: Hi I need to add a button that will redirect to a specific page on a HTML form This button must be visible or not visible based on a condition from an authentication field I created the html form and added this code: <script> if("[@authfield:User_Role]" == "Manager") { ---> Add a code here that will show a button that will redirect to a page } </script> Can someone send me an example code that I can place between the brackets? I tried several options but nothing works. Try using document.write, e.g.: document.write('<button onclick=document.location.href="https://www.google.com">take me away</button>'); Quote Link to comment Share on other sites More sharing options...
LuluSW Posted August 30, 2017 Author Report Share Posted August 30, 2017 Thanks Matilda! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.