ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Adding A Popup Menu To Mail Contact Form

June 03, 2011 2:33pm

Subscribe [4]
  • #1 / Jun 03, 2011 2:33pm

    maury.mccown

    87 posts

    Hey all

    I would like to add a popup menu to my EE Mail Contact Form, but I’m not sure how. I’m wanting to use it as a way to separate messages to individuals using, say, the subject line—yet under the same email address (I won’t bore y’all with the why of this decision). For example:

    - Messages meant for general questions could have a popup item named “General Questions”
    - Messages for a clothing specialists would have a popup item named “Clothing Questions”
    - and so on.

    I would then add the selected popup text as the message’s subject line when the user hit the send button.

    Is this doable?

    [Mod Edit: Moved to the Community Help forum]

  • #2 / Jun 04, 2011 3:35pm

    Greg Salt

    3988 posts

    Hi Maury,

    This is the kind of thing that jQuery is perfect for. EE has a jQuery Module that makes it easy to add the framework to your templates. I’ll move this thread to the Community Help forum where you can get some input into the best way to approach this.

    Cheers

    Greg

  • #3 / Jun 04, 2011 4:26pm

    Kernon

    173 posts

    Maury,

    Would then entire subject line be the text you specify (e.g., “General Questions”)?  If so, I don’t see why you couldn’t just have a selection list or radio button for the user, and then you would submit the associated desired text as the subject line in the form.

  • #4 / Jun 04, 2011 8:57pm

    maury.mccown

    87 posts

    Yes, that’s what I would do—but I’m not sure about how to implement it. Here’s my code:

    {exp:email:contact_form user_recipients="false" recipients="[email protected]" charset="utf-8" return="{homepage}/pages/thank_you/" redirect="0"}
    
    <label for="from"><strong>Name:</strong></label>
    
    <input type="text" id="name" name="name" size="40" maxlength="35" value="{member_name}" /></p>
    
    <label for="from"><strong>Email:</strong></label>
    
    <input type="text" id="from" name="from" size="40" maxlength="35" value="{member_email}" /></p>
    
    <label for="subject"><strong>Subject:</strong></label>
    
    <input type="text" id="subject" name="subject" size="40" value="" /></p>
    
    <label for="message"><strong>Message:</strong></label>
    
    <textarea id="message" name="message" rows="18" cols="75"></textarea>
    
    <input name="submit" type='submit' value='Send Message' /></p>
    
    
    {/exp:email:contact_form}
  • #5 / Jun 04, 2011 9:49pm

    Kernon

    173 posts

    I haven’t tested this, but you could replace your existing ‘subject’ section with something like the following:

    <label for="subject"><strong>Subject:</strong></label>
    
    <input type="radio" name="subject" value="“General Questions"> General Questions
    
    <input type="radio" name="subject" value="“Clothing Questions"> Clothing Questions
    
    <input type="radio" name="subject" value="whatever"> ANOTHER…
    
  • #6 / Jun 04, 2011 10:46pm

    maury.mccown

    87 posts

    I haven’t tested this, but you could replace your existing ‘subject’ section with something like the following:

    <label for="subject"><strong>Subject:</strong></label>
    
    <input type="radio" name="subject" value="“General Questions"> General Questions
    
    <input type="radio" name="subject" value="“Clothing Questions"> Clothing Questions
    
    <input type="radio" name="subject" value="whatever"> ANOTHER…
    

    I’m needing this to be in a pulldown menu, though, not radio buttons—that’s what I’m having a hard time getting to work properly.

  • #7 / Jun 04, 2011 10:53pm

    maury.mccown

    87 posts

    Okay, I got it figured out—I just needed to put select name=“subject” before the pulldown options.

    Thanks for the help!

  • #8 / Jun 05, 2011 2:12am

    Roger Glenn

    54 posts

    Something like this should do the trick.

    
    <label for="form_subject"><strong>Subject:</strong></label>
    
    <select id="form_subject" name="subject">
      <option value="General Questions"> General Questions</option>
      <option value="Clothing Questions"> Clothing Questions</option>
      <option value="whatever"> ANOTHER…</option>
    </select>
    
.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases