Dialog On Close

I have some code I want to run when a modal dialog closes. How do I capture that event?

Hello @sphilson,

What type of dialog is it? Is it a form that is opened in a dialog?

Yes, a dialog opened by a Sharepoint List/Library control.

I have (temporarily) added my code to the spBeforeSave, but if I keep the code here, I want the ability to stop form from closing if there is an error.

Hello @sphilson,

Do you want to validate the form before close?

If so, you can add a custom close button and add the code that will validate the form on form close. You can find the code example that validates form here.