Dynamically set link of button & open two links

Hey everyone,

I have set up the following:
A light box with user input field and a button.
I want to achieve the following:

  1. on button click a check is activated whether the input field have a value and whether its valid (figured out how to do that with on change function and a validity check)
  2. if the value is valid I would like to open a link that contains information of the inputfields
  3. I would like that link to open in a new tab
  4. At the same time I would like the lightbox to close

The issue is that with location.to you can’t open a new link and I can’t figure out how to close the lightbox and dynamically generate the link without using location.to

Any help is much appreciated!

Thanks!

Joern

Hi,
you can use link method and make it open in a new tab. Click here to learn how.

You can user the close method to close the lightbox. Click here to see how.

Hi Aleks,

I am aware of the link method and the close method. But how would I trigger them to achieve the above scenario?