external contact form into overlay <- how to keep overlay layer after submit?

external contact form into overlay <- how to keep overlay layer after submit?

Hello
I've spend couple hours on learning how to use basics of jquery, and I have enough :\
I made a contact form in php, and I wanted to load it into overlay layer.
I achieved this, but now I have no idea how to keep the contact form on the layer after submitting the message.
I need it to handle errors in form and to inform the user, if the form has been submitted.
The form doesn't utilize any jscript.

Is it doable  ?

I'm using basic overlay code to load the form from external file

  1. $(function() {
  2.     $("a[rel]").overlay({
  3.         mask: '#58beea',
  4.         effect: 'apple',
  5.        
  6.         onBeforeLoad: function() {
  7.             var wrap = this.getOverlay().find(".contentWrap");
  8.             wrap.load(this.getTrigger().attr("href"));
  9.         }
  10.     });
  11. });
  12. </script>
+ trigger link
  1. <a href="form.php" rel="#overlay" style="text-decoration:none">
  2. contact me
  3. </a>

I couldn't find any solutions in search engines, so I ask you for some help.