Buttons to open web page in html widget

I want to create 2 buttons and when I click on the first button I want to load a html page inside the html widget area and then when I click on the second button then I want to load another page inside the same html widget. I guess using a class this is possible. How can I do this?

Hi,

You can try the following suggestion to achieve your wish:

  1. Add two HTML Widget to the Canvas.
  • Make sure they have the same width/height and cover each other.
  • In the Propeties pane > General tab > General section > Display > Off.
  1. Add events-actions to these 2 button. For example, using Show/Hide Element action.
  • Button 1: Click the Event Handlers button > On Click event > Add Action button > add the following actions:

  • Button 2: Click the Event Handlers button > On Click event > Add Action button > add the following actions:

BR,

Thank you!, I have tried this method before but what I am looking for is only using one html widget. I think this is posible with some JS and target the html widget. Please let me know how I can do this. Thanks!

Hi,

If you want to use one HTML widget, you can try using the following script:
doc.getElement(‘html widget name’).setUrl(‘page url’);

Hope that it helps.

BR,