Rich Text Formula to Open URL In New Window

  • 1
  • 1
  • Question
  • Updated 3 months ago
  • Answered
Hi all,

I wanted to create some buttons on a form in my app that show an image, and clicking on it sends you to a URL.

the field type is Formula - Rich Text and the code is below...

"<a href=\"MyURL"><img src=\"MyImage" width=125></a>"

this formula works but opens the URL in the same window. Can someone please advise how i would amend this code to have the link open up in a new window?

I chopped together this formula from the magic buttons app and i tried searching the forum for the answer but to no avail

Thanks in advance :-)
Photo of Jafar Tiyar

Jafar Tiyar

  • 142 Points 100 badge 2x thumb
  • tired

Posted 3 months ago

  • 1
  • 1
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 51,436 Points 50k badge 2x thumb
Try this


"<a target="_blank"
 href=\"MyURL"><img src=\"MyImage" width=125></a>"
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 51,436 Points 50k badge 2x thumb
ie.

"<a target="_blank" href= .. etc
Photo of Jafar Tiyar

Jafar Tiyar

  • 142 Points 100 badge 2x thumb
thanks for the fast reply. I tried that and get the following error
Photo of Rob White IV

Rob White IV

  • 948 Points 500 badge 2x thumb
You’re building a string containing quotes. You’ll have to escape them or change the quote types. See if changing the quotes around “_blank” to single quotes works. You’ll need to do the same for the other attribute too.
Photo of Jafar Tiyar

Jafar Tiyar

  • 142 Points 100 badge 2x thumb
you're a legend mate, that did the trick

Cheers lads