Hi Keith,
Thanks for the fast response. Unfortunately it is not an option as I am using a bean and not Domino document data source and thus there is not postSaveDocument event available and also I need the JS client side to be executed.
Anyway, it seems that I oversimplified the description, so there is one more try:
I would like to assemble simple prototype workflow application. I would like to have Submit for Approval button that saves the document (if all validations are passed) and if save is completed then shows the modal dialog window where the user can specify who will be the approver and put a comment. If closed with OK the document is moved to another status and a mail alert is being sent.
The problem that I am currently facing is the fact that onComplete event connected to Submit for Approval button is fired even if the document is not saved due to not passed validation.