form submit via popup
<p>I have made a form. I want to open a inline popup on submit and make a text box in the popup that is compulsory to be filled and then in the popup when the user submits a form, the form then gets submitted via popup and page gets refreshed.</p>

<p>I am not able to show alert box in the popup and submit the form via popup. </p>

<pre><code>&lt;script type="text/javascript"&gt;
$(document).ready(function() {

  $("#submit").click(function(){
    $(".variousz").trigger('click');

  });

$(".variousz").fancybox({
    maxWidth    : 800,
    maxHeight   : 600,
    fitToView   : false,
    width       : '70%',
    height      : '70%',
    autoSize    : false,
    closeClick  : false,
    openEffect  : 'none',
    closeEffect : 'none',
    afterClose: function(){
         $('#formsubmit').submit();
        }

});
$("form").submit(function() {
 if ($('#accept').val() == 'ACCEPT'){ } else { $("span").text("Query is Not valid!").show().fadeOut(1000);
 return false; }
});
});
&lt;/script&gt;
&lt;body&gt;

    &lt;div id="inline" style="display:none;width:500px;"&gt;
        &lt;h2&gt;Lorem ipsum dolor sit amet&lt;/h2&gt;     
        &lt;p&gt;
            &lt;input type="text" name="accept" id="accept" value=""&gt;&lt;span&gt;&lt;/span&gt;

        &lt;/p&gt;
        &lt;p&gt;
            Lorem ipsum dolor sit amet, consectetur adipiscing elit.
        &lt;/p&gt;
    &lt;/div&gt;  
    &lt;div class="tab_container"&gt;
            &lt;a style="display:none;" class="variousz" href="#inline"&gt;Inline&lt;/a&gt;

            &lt;form method="GET" action="test.html" id="formsubmit" onsubmit="test.html" &gt;
            &lt;input type="text" name="aaa"&gt;
            &lt;input type="button" id="submit" value="submit"&gt; 
            &lt;/form&gt;
    &lt;/div&gt;
</code></pre>
