Cancel button stateless form?

Cancel button stateless form?

How do I implement a "Cancel" button on a stateless form which simply closes the form? (The form in question is opened in a modal window via a custom button action in a view.)