title: How to submit a fancybox form?
body: <p>I am using fancybox to open submitted form like this:</p>
  
  <pre><code>&lt;form name="form" id="myForm" action="{$smarty.server.PHP_SELF}?action=abc" method="post" target="iframe" onsubmit="document.getElementById('iframe').src='{$smarty.server.PHP_SELF}?action=abc';"&gt;    
  &lt;input type="hidden" name="xyz" value="123"&gt;
  &lt;input type="submit" value="REGISTER" id="button" class="button"&gt;
  &lt;/form&gt; 
  
                  $("#button").click(function() {                                            
                  $("#iframe").fancybox({
                  'titlePosition'     : 'inside',
                  'transitionIn'      : 'fadeIn',
                  'transitionOut'     : 'fadeOut'
                  }).click();                            
              });
  </code></pre>
  
  <p>with <code>&lt;input type="submit" value="REGISTER" id="button" class="button"&gt;</code> everything is </p>
  
  <p>working fine. but for some reason i need to use <code>&lt;a href=""&gt;REGISTER&lt;/a&gt;</code>. So I tried</p>
  
  <pre><code>&lt;a href="#" onclick="document.getElementById('myForm').submit();"&gt;REGISTER&lt;/a&gt;
  </code></pre>
  
  <p>&amp;</p>
  
  <pre><code>&lt;a href="javascript:document.form.submit();"&gt;REGISTER&lt;/a&gt;
  </code></pre>
  
  <p>In above cases fancybox is popping out but my form is not getting submitted.</p>
  
  <p>How do I submit my form successfully within click function?</p>