Skip to main content
Question

Including two classes in one button

  • July 2, 2025
  • 0 replies
  • 304 views

TeamKinnect
Forum|alt.badge.img+3

I'm working with a rich text button. The button is on a parent record. The user clicks the button, the parent is saved, and then a popup opens to add a child record. When I add the savebeforenavigating class, the button stops opening the window in a popup and instead opens in a new tab.

Is it possible to include both classes in the same formula?

var number rid = [Record ID#];var text url = 
URLRoot() & "db/" & [_DBID_CHILDREN] & "?a=nwr" & "&_fid_10=" & URLEncode($rid) & "&ifv=1" & "&hs=1";
var text color = "#228B22";
var text txtcolor = "White";

"<a class='SaveBeforeNavigating' & \"OpenAsPopup\" data-height=\"800\" data-width=\"1000\" data-refresh=\"true\" " &
 "style=\"text-decoration: none; text-align: center; background:" & $color & "; color: " & $txtcolor & "; border-radius: 5px; margin: 2px; padding: 5px 5px; width: 100px; display: inline-block; font: 14px/ 'Calibri', 'Segoe UI', sans-serif; text-shadow: none;\"href='" & $url & "'>Add Child</a>"

EmberKrumwied
Forum|alt.badge.img+13
  • Quickbase Alumni
  • August 20, 2025

I think I need something like this as well. Anyone know if this is possible? My use case is that I have a Save and Refresh button on a form that is primarily interacted with as a popup subform. When I use the Save and Refresh button it saves, refreshes but now my popup subform is now a full windowed form. Looking for a way to save and refresh and retain popup subform display.


Forum|alt.badge.img+11
  • Quickbase Alumni
  • August 20, 2025

The classes are CSS classes. In that sense, you can put as many as you want. Try it out like this to see if it works as intended:

"<a class='SaveBeforeNavigating OpenAsPopup' data-height=\"800\" data-width=\"1000\" data-refresh=\"true\" " &
 "style=\"text-decoration: none; text-align: center; background:" & $color & "; color: " & $txtcolor & "; border-radius: 5px; margin: 2px; padding: 5px 5px; width: 100px; display: inline-block; font: 14px/ 'Calibri', 'Segoe UI', sans-serif; text-shadow: none;\"href='" & $url & "'>Add Child</a>"

If it doesn't work, then it's an incompatibility with the script QuickBases uses.


EmberKrumwied
Forum|alt.badge.img+13
  • Quickbase Alumni
  • August 20, 2025

Guess it is a QuickBase script issue as I get the following after updating the code and using the button.

Bummer.


EmberKrumwied
Forum|alt.badge.img+13
  • Quickbase Alumni
  • August 20, 2025

var text rid = 
    If([CID]>0,
        ToText([CID]), // Record ID already exists
        "%%rid%%" // New record, no Record ID exists yet
    )
;
var text url = URLRoot() & "db/" & Dbid() & "?a=er&rid=" & $rid;

"<a class='Vibrant Primary SaveBeforeNavigating OpenAsPopup' data-replaceRid=true href='" & $url & "'>Save & Refresh Pricing</a>"