jQuery dialog related post
<p>I am using jQuery .dialog() in my code.
In dialog i am having Form. On ok button of dialog, i want to submit the form...but It is not submitting code on ok. I have written  tag in dialog. Am i writing something wrong</p>

<pre><code>&lt;div id="dialog-form" title="Create new user"&gt;
    &lt;p class="validateTips"&gt;All form fields are required.&lt;/p&gt;

    &lt;form id='form1' name='form1' action='next.php'&gt;
    &lt;fieldset&gt;
        &lt;label for="name"&gt;Name&lt;/label&gt;
        &lt;input type="text" name="name" id="name" class="text ui-widget-content ui-corner-all" /&gt;
        &lt;label for="email"&gt;Email&lt;/label&gt;

        &lt;input type="text" name="email" id="email" value="" class="text ui-widget-content ui-corner-all" /&gt;
        &lt;label for="password"&gt;Password&lt;/label&gt;
        &lt;input type="password" name="password" id="password" value="" class="text ui-widget-content ui-corner-all" /&gt;
    &lt;/fieldset&gt;
    &lt;/form&gt;
&lt;/div&gt;

$( "#dialog-form" ).dialog({
    autoOpen: false,
    height: 300,
    width: 350,
    modal: true,
    buttons: {
        OK: function() {
            //$( this ).dialog( "close" );
            $('#form1').submit();
            return true;
        },
        Cancel: function() {
            $( this ).dialog( "close" );
        }
    },
    close: function() {
        allFields.val( "" ).removeClass( "ui-state-error" );
    }
});
</code></pre>
