Forum Discussion

BenjaminBrooks's avatar
BenjaminBrooks
Qrew Trainee
4 years ago

Color Change When Button is Pressed

Hello Everyone,

I am trying to make a button that changes color when it is clicked from white as default to blue. It will also select the item in the multi-select text in the fid 144 to IEP. Then redirect back to the record in edit mode. I am missing something here and i cannot figure it out. I am using a rich text formula field.


var text URLONE = URLRoot() & "db/" & Dbid()
& "?act=API_EditRecord&rid=" & [Record ID#]
& "&_fid_144=IEP";


var text URL =
"javascript:" &
"$.get('" &
$URLONE &
"',function(){" &
"location.reload(true);" &
"});"
& "void(0);";

If(ToText([Benefit Period])="IEP",

"<a class='Vibrant Snowy'IEP</a>",

"<a class='Vibrant Primary' style='border:1px solid #6BBD57; background-color:#6BBD57'" & "a href=" & $URL & ">IEP/a>")

------------------------------
Benjamin Brooks
------------------------------

1 Reply

  • AustinK's avatar
    AustinK
    Qrew Commander
    The bottom bit looks to be broken in a few different ways.  Try this as a replacement for the bottom 2 lines and see if it helps.

    "<a class='Vibrant Snowy'>IEP</a>",

    "<a class='Vibrant Primary' style='border:1px solid #6BBD57; background-color:#6BBD57'" & "a href=" & $URL & ">IEP</a>")