Close form on Save
By default the SAVE button does not close the form, which I often need it to do. I am using a workaround by have a custom button labeled SAVE actually SUBMIT, then using a condition to push the flow back to the user. This solution has its own challenges such as resending the Initiation email each time the user "saves," which is a nuisance. Is there a way, using JavaScript perhaps, to automatically close the form on Save?
-
Michael,
I think you can do what you are trying to do like this:
Create a simple JavaScript function to close the active window:
function closeWindow()
{
window.close();
}From what I have read and from my testing, the default behavior is that the window.close command will only close the current active tab in your browser.
Create your Custom Button:

Configure your button to do a "Save" Action:

Then on the Advanced tab, tell it to execute the JavaScript function:

I did a quick test of this and it seemed to work fine. I changed some data on a textbox in the form and then when I clicked the "Save & Close" button, my changes to the textbox value were saved in the process schema and the browser tab closed.
-
It was bugging me about why this did not work in Firefox. It seemed like the window was closing before the Save action could occur. So I modified the JavaScript function to add a 100 millisecond delay before it executes the close command like this:
function closeWindow()
{
setTimeout(function() {
window.close();
}, 100);
}And now it does work in Firefox!
Please sign in to leave a comment.
Comments
4 comments