DoSave button options?

  • 0
  • 1
  • Question
  • Updated 3 months ago
  • In Progress
There seems to be a lot of options when using custom buttons/javascript with onclick="DoSave()" functionality. 

Does anyone have a "cheatsheet" regarding the different options there are, and how each works, and the parameters that may be included ?

onclick="DoSave()"
onclick="DoSaveAdd()"
onclick="GeditDoSave(dbid,true)"  (no idea what the "true" is for here, for example)

(Question comes as I was trying to use a pop-up window with an &ifv of a record, to add a file attachment, as it provided a cleaner look for the user, but save functionality of DoSave doesn't attach the file, only saves the record).




Photo of Carlos

Carlos

  • 644 Points 500 badge 2x thumb

Posted 3 months ago

  • 0
  • 1
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 26,302 Points 20k badge 2x thumb
I would not use these functions. Years ago QuickBase's form submission was a lot simpler and the DoSave() function was very prominent in the source code. Today the form is a lot more complicated and there other services provided by the form submission other than simply submitting the for data. Calling DoSave() or other QuickBase authored functions may well short circuit some of these features.

The better solution is to arrange for your script to emulate or intercept user input. This way you can gain control over the form without modifying QuickBase's authored code.

var originalClickHandler = $("#saveButton").data("events").click[0].handler;

$("#saveButton").unbind("click");
$("#saveButton").click(function() {
  //your code here
  //conditionally call QuickBase's originalClickHandler();
  //originalClickHandler();
});
(Edited)