really this is not a supported scenario, it will require hand coding the event to close the window.
you could probably do something like set the for to post to itself using a querystring variable.
then use php to include the javascript window.close event using an if statement.
you will need to comfortable with PHP and javascript to get it to work the way you want though.