I have this in a php file from Contact Form 7, which I load into a modal window (FancyBox) and I would like to close it after the user will press the Submit button.
I was thinking of adding onSubmit="action" to the form but I don't know how or which one is the function I am supposed to use to close the modal window?
$form .= '<form action="' . esc_url_raw( $url ) . '" method="post"' . ' class="' . esc_attr( $class ) . '"' . $enctype . '>' . "\n";
Is this the right approach?
Also, if I can make it to click on a PayPal button right after that, it will be brilliant.

esc_urlinstead ofesc_url_raw, the raw version is for database storage and internal use inside of PHP. – soulseekah Mar 13 '12 at 10:46