Forum Discussion
_anomDiebolt_
7 years agoQrew Elite
Submit the form with script using FormData:
This script (1) creates a FormData object equivalent to the QuickBase form, (2) sets the subact hidden field to "save" and (3) submits the from via fetch which returns a promise. When the promise resolves, the page redirects to ibm.com.
Speaking of promises, I got to get me a one of those big async yard signs:
var editform = document.getElementsByName("editform")[0];
var formData = new FormData(editform);
formData.set("subact", "save");
window.onbeforeunload = null;
fetch("bnzwm7ykp?a=FinishEditRecord", {
body: formData,
method: "POST",
credentials: "include"
}).then(function(response) {
document.location.href = "https://ibm.com";
});
This script (1) creates a FormData object equivalent to the QuickBase form, (2) sets the subact hidden field to "save" and (3) submits the from via fetch which returns a promise. When the promise resolves, the page redirects to ibm.com.
Speaking of promises, I got to get me a one of those big async yard signs: