Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7530455
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T04:54:59+00:00 2026-05-30T04:54:59+00:00

All, I’m trying to send an email with the jQuery dialog modal window. I

  • 0

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:

$( "#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" );
    }
});

Then here is my dialog form:

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

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?

Thanks for any help in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T04:55:00+00:00Added an answer on May 30, 2026 at 4:55 am

    Sounds like you just need to print out the emails from your session into the markup for your dialog box. You’re wanting to add them as options for the select element, right?

    <div id="dialog-form" title="Email Vendors">
    <form>
    <div id="email_options">
    <select data-placeholder="Vendors to Email" style="width:350px;" multiple class="chzn-select">
    
    <?php foreach ( $_SESSION['emails'] as $e ): ?>
        <option><?php echo $e; ?></option>
    <?php endforeach; ?>
    </select>
    </div>
    </form>
    </div>
    

    Assuming the emails are stored as array in $_SESSION['emails']. I also moved your email_options div outside of the select for the sake of valid XHTML.

    Update

    Since you clarified that users are able to add emails to the session on the fly after the page is loaded, when you add emails to the session you should use some JavaScript to keep your session and the dialog box synchronized. Something like this:

    /* Where ever you update the session with more emails, also do this
    Note, this is using the modified markup from my above example 
    (select is child of #email_optons) */
    
    var new_email = '';  // Set this to the value of the email which is being added to the session
    
    $('#email_options select').append( $('<option>' + new_email + '</option>' ) );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

All, I'm trying to use the jQuery Form Validator (http://docs.jquery.com/Plugins/Validation). However I'd like to
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
All, I am using the JQuery Autocomplete Plugin 1.0.2 in a JQuery UI Dialog.
All too often I want a WPF slider that behaves like the System.Windows.Forms.TrackBar of
All, I am trying to create a table to receive user inputs (UGC). This
I am trying to render a haml file in a javascript response like so:
All of a sudden my form link looks like this: <form action=/r.ashx/Models.Module_ContactUs?action=Submit&amp;controller=Contact id=contactUsForm method=post>
all, I am trying to multiply a matrix to a vector in OpenGL, but
All, I'm trying to split my MSTest test run into multiple runs because I'm
All the examples I can find using DLLImport to call C++ code from C#

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.