Page 1 of 1

Open hyperlink

Posted: Tue Mar 23, 2021 7:16 pm
by treed
Getting back into our unBuilder project again and I'm looking to do something simple, but can't find an example. I have an edit screen with a field containing a hyperlink. How would I open it in a new window using a button?

Re: Open hyperlink

Posted: Tue Mar 23, 2021 8:17 pm
by kev1n
Hi,

In your Button's Custom Code, add an onclick event with this JS:

Code: Select all

   var v = $(' #your_field_that_contains_the_url_id').val();
        if (v.length !== 0) {
            window.open(v, '_blank');
        }