I have a form that involves multiple submissions across departments. How would I code it so that the second Submit button is invisible until the first Submit button is clicked? Likewise, I'm wanting the first Submit button (the initially visible one) to become invisible when it is clicked. So basically, I only want to have one Submit button visible at a time. I see where the stock actions for buttons allow me to show/hide a field, but I see nothing equivalent for a button.
// Hide this button
event.target.display = display.hidden;
// Show another button
getField("Submit2").display = display.visible;
// Show another button, but make it non-printing
getField("Submit3").display = display.noPrint;
But I don't think it is a good idea to do this. Consider what will happen if the first email is canceled or otherwise fails for some reason. The user would likely want to try again but won't be able to if the submit button is no longer available, unless you provide some means to undo the hiding/showing of the submit buttons.