Skip to main content
Question

New Window instead of new tab

  • March 24, 2017
  • 0 replies
  • 82 views

So I have a formula URL that has the option ticked for "open in new window"...and this does sort of work---it's a limitation of my BROWSER settings that it chooses new windows to open in new TABS. And while that is normally the behavior I prefer (in general), I would like to make my "click to track" button actually open in a new window regardless of my browser settings.
I assume this is a javascript thing, but since I don't KNOW javascript, I'm hoping one of you out there in Qbase land smarter than I can help me?
This topic has been closed for replies.

  • Registered
  • March 25, 2017
Hi Stephen, I've done this a few times, usually in formula text fields. The basic idea is that you need a little bit of javascript ahead of the url, something like: onclick=\"var a=window.open('"&[url goes here], 'newwindow', 'width=600,height=200');

Where the width and height control the size of the window, however you can probably remove that or add a full size modifier. 

If you need assistance making this work, feel free to reach out to me via the info in my profile and my team can help you further. 

Good luck! 

onclick=\"var a=window.open('"&[url goes here], 'newwindow', 'width=600,height=200'); 
Gives a warning that it needs a parenthesis after onclick..I was using a formula URL (not formula text) so I just must have my syntax wrong?

  • Registered
  • March 30, 2017
I think Eric was providing you with an example to show you the proof of concept.

You will need it to be a formula-text field and the portion that contains the action when clicked will be:

"<a class='Vibrant Success' onclick=\"var a=window.open('https://www.google.com/', 'newwindow', 'width=600,height=600');\" >Google</a>"

This one is tested and works.

Matthew, (and Eric) yes, thanks! I'm completely uneducated on Javascript and even when I look things up on the 'net I find that I'm struggling with syntax. Thank you for helping me apply what eric did to the field. Is there some sort of resource regarding syntax for basic stuff like this you might suggest to help newer-users like me who have some programming knowledge (enough to be dangerous) but are unfamiliar with syntax and other applications of the details? 
I am doing some online javascript tutorials to learn the basics but still hope to find a reference on how to apply them specifically to quickbase.