Skip to main content
Question

How do I Edit a form and click on a button to perform API command(s) WITHOUT saving before clicking on the button?


I use Rich Text formula buttons and the code for returning to the same location the button was used for returning to where the button was pressed. Like below

"<a " & $style & " href=\"javascript:" & "$.get('" & $URL & "', function(){" & "location.reload();" &
 "});" & "void(0);\"> Start Configuration </a>"

But when used on a form if you have edited you have to save then click on the button. I found this string of code

onclick='saveButton.click();'

Then placed the code in the button like below and it saves and executes the API commands that I use in the $URL .

"<a " & $style & " href=\"javascript:" & "$.get('" & $URL & "', function(){" & "location.reload();" &
 "});" & "void(0);\"onclick='saveButton.click();'> Start Configuration </a>"

On a side note I got into the habit of using the Rich Text Formula instead of the standard URL for buttons to mouse over coloring and to dynamically name buttons. Such as having a check in button for technicians but using the technician name in the button. This code did present a small issue that I used a variable to resolve. Example below.

var text lead = [Technician Name];


"<a " & $style & " href=\"javascript:" & "$.get('" & $URL & "', function(){" & "location.reload();" &
 "});" & "void(0);\"onclick='saveButton.click();'><center> Check In <br> "& $lead &"</center> </a>"



This topic has been closed for replies.

Forum|alt.badge.img+11
  • Quickbase Staff
  • October 8, 2018
Hi Jason - while there are currently workarounds and non-native solutions, Quick Base does not support custom JavaScript-based ajax operations on the page. Would you mind sharing the use case of why this is interesting? Also, have you looked at QB Automations instead of injecting your own JavaScript?