how to close dialog in jquery automatically on some condition
<p>I have some group of check box of which user has to select atleast one and proceed further activity.
when the user clicks on a button i check the above functionality if the user has selected one than allow to open a dialog else alert the user to select minimum one and don't open the Dialog.</p>

<p>following is the function to open a dialog.</p>

<pre><code>function openLoadInfo(){
    global.getElementById("diaLoad").value="";
    global.getElementById("diaReadydate").value="";
    global.getElementById("diaCanceldate").value="";

      $("#loadinfo")
        .dialog(
                {
                    modal: true,
                    draggable: false,
                    closeOnEscape: true,
                    title: "Load # info",
                    resizable: false,
                    width: 300,
                    // open: function() {
                    //            
                    // },
                    buttons: {
                        Ok: function () {
                           $(this).dialog('close');
                        }
                    }
                });
</code></pre>

<p>through the following script i am able to get value if check box is selected .</p>

<pre><code>$('input:checked').each(function() {
          alert("Value : "+$(this).val());
        });
</code></pre>

<p>if the above code fails than i have to close the dialog and prompt the user to select at least one check box.</p>

<p>Please help me to get this.</p>

<p>Regards</p>

<p>}</p>
