How to close a modal box after form submit?
I am using the css modal box described by Paul R.Hayes here - http://www.paulrhayes.com/experiments/modal/
I have inserted a form into the modal box. The form target is in an iframe which is hidden on the same page. I want to close the modal window as soon as the form submits. But the form should be processed within the iframe (hidden).
How can I achieve this?
It looks like the modal window is closed by any url linking to the #close html fragment.
Therefore adding the following code to the submit handler of your form should close the modal on submission.
<form ... onsubmit="window.location.assign('#close')">