My question is, how can I evaluate what button they pressed from the save/print dialog boxes. Currently, if they press the Save button, the save dialog box comes up and if they hit save it saves it and makes the whole form as read only. If they Save and then press cancel, it doesn't save and still marks the whole form as readonly. Same goes for the printer dialog box. Thoughts?
You could use a post event (postSave or postPrint), but you will have the same trouble. If the user cancels the save/print, the relevant post event will still fire.
This is because the pre/post events, like preSave and postSave, are a pair.
Thinking about it, does the user appreciate that if they click the save or print button, that the form will actually lock? Will they get a nasty surprise after printing the form, that they can no longer edit it?
One posible solution would be to have a single button visible "Finish and lock this form", with a suitable tooltip. In the click event the script would lock the form, hide the "Finish" button and show the "Save" and "Print" buttons.