Forum Discussion

MikeTamoush's avatar
MikeTamoush
Qrew Commander
2 years ago

Rich Text Button Syntax Help

Typically for open as popup, I have something like this:

var text URL = MyURL
"<a class='OpenAsPopup' data-height=800 data-width=900 data-refresh=true style=\"text-decoration:none; background: #688EB3; border-radius: 5px; color: #ffffff; display: inline-block; width:145px; height:22px; text-align: center;  font-size: 12px \"href='"
& $URL
& "'>Button Words Here</a>"

I am trying to make the Open as popup a variable, so something like:

var text Popup = If(Condition = true,"class='OpenAsPopup' data-height=800 data-width=900 data-refresh=true");

"<a" &Popup &  "style=\"text-decoration:none; background: #688EB3; border-radius: 5px; color: #ffffff; display: inline-block; width:145px; height:22px; text-align: center;  font-size: 12px \"href='"
& $URL
& "'>Button Words Here</a>"

The above didnt work. I know it is the syntax of how i added that variable in. Can anyone explain how to do it?

------------------------------
Mike Tamoush
------------------------------

2 Replies

  • Try this

    var text Popup = "class='OpenAsPopup' data-height=800 data-width=900 data-refresh=true";

    var text DoIt=
    "<a" &Popup &  "style=\"text-decoration:none; background: #688EB3; border-radius: 5px; color: #ffffff; display: inline-block; width:145px; height:22px; text-align: center;  font-size: 12px \"href='"
    & $URL
    & "'>Button Words Here</a>";

    If(Condition = true, $DoIt)


    ------------------------------
    Mark Shnier (Your Quickbase Coach)
    mark.shnier@gmail.com
    ------------------------------
    • MikeTamoush's avatar
      MikeTamoush
      Qrew Commander
      That may work, but ultimately doesn't save me code. The idea is that I want to have the same button push, but in certain scenarios it is a popup, and in others it is not.

      I can do it by something similar to what you have, but Ill have to have a second variable Dolt2 which is the same but without the popup.

      Since all my style is the same, I was just trying to come up with cleaner code where I ddint have to write it all twice. The solution may be to make the style a variable...?

      ------------------------------
      Mike Tamoush
      ------------------------------