jQuery Dialog but get dynamic inputs
<p>All,
I'm trying to send an email with the jQuery dialog modal window. I can get the window to populate correctly and everything like that however I'm trying to populate some email addresses when I open the dialog window. Here is the jQuery to open the dialog window:</p>

<pre><code>$( "#dialog-form" ).dialog({
    autoOpen: false,
    height: 600,
    width: 750,
    modal: true,
    show: 'slide',
    buttons: {
        "Send Email": function() {
                var message_to_send = $( "#message_to_vendors" ).val();
                alert(message_to_send);
                var vendor_ids = $("#email_vendor_ids").val();
                alert(vendor_ids);
                $.post("send_vendor_emails.php", { email_vendor_ids: vendor_ids, message_to_vendors: message_to_send }, function(data) {
                    alert("The data is: "+data);
                    if(data=="yes"){
                        $("#dialog-form").dialog( "close" );
                    }
               });

        },
        Cancel: function() {
            $( this ).dialog( "close" );
        }
    },
    close: function() {
        allFields.val( "" ).removeClass( "ui-state-error" );
    }
});
</code></pre>

<p>Then here is my dialog form:</p>

<pre><code>&lt;div id="dialog-form" title="Email Vendors"&gt;
&lt;form&gt;
&lt;select data-placeholder="Vendors to Email" style="width:350px;" multiple class="chzn-select"&gt;
&lt;div id="email_options"&gt;
&lt;option selected&gt;Email Address 1&lt;/option&gt;
&lt;option selected&gt;Email Address 2&lt;/option&gt;
&lt;/div&gt;
&lt;/select&gt;
&lt;/form&gt;
&lt;/div&gt;
</code></pre>

<p>I'm storing some email addresses in session variables and what I'd like to happen is when I click the dialog box to open it up that I can populate the email addresses in the Session variables. How can I do that with the dialog box?</p>

<p>Thanks for any help in advance!</p>
