title: Submit Form And Close Fancybox, Javascript
body: <p>I'm using Fancybox to trigger a search form pop-up and the form uses Javascript validation to check and submit. The problem that I have is that I can't get the Fancybox screen to close and then run the function. Here is the code that I'm using at the moment:</p>
  
  <pre><code>&lt;form id="searchForm" method="post" action="&lt;?php echo $search; ?&gt;.php?type=rad" onsubmit="javascript:parent.jQuery.fancybox.close();"&gt;
  
  $('#enterButton').click(function()
          {
          if(searchok == 1)
          {           
              $('.searchValidation').addClass("sending");
              $("#searchForm").submit();
          }
          else
          {
          $('.searchValidation').addClass("validationError");
          }
          return false;
          });
  </code></pre>
  
  <p>How can I get the fancybox window to close on submit() but still effectively run the form function in the parent window?</p>