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.

Help with email module

October 06, 2008 9:32pm

Subscribe [1]
  • #1 / Oct 06, 2008 9:32pm

    Wired

    181 posts

    I can’t seem to pass extra fields with the email module. I’ve read the manual and I can’t see to figure out why:

    {exp:email:contact_form user_recipients="false" recipients="[email protected]" charset="utf-8"  }
                
                <label for="name"><b>Name/Alias:</b> 
    
                <input type="text" name="name" size="40" /><br >
                
                <label for="from"><b>Your Email (Your email is safe with us):</b></label>
    
                <input type="text" id="from" name="from" size="40" maxlength="35" value="{member_email}" /></p>
                <select name="message[]">
                <?php
                    $states_of_the_USA = array (1 => "Alabama", "Alaska", "Arizona", "Arkansas", "California", "Colorado", "Connecticut", "Delaware", "Florida", "Georgia", "Hawaii", "Idaho", "Illinois", "Indiana", "Iowa", "Kansas", "Kentucky", "Louisiana", "Maine", "Maryland", "Massachusetts", "Michigan", "Minnesota", "Mississippi", "Missouri", "Montana", "Nebraska", "Nevada", "New Hampshire", "New Jersey", "New Mexico", "New York", "North Carolina", "North Dakota", "Ohio", "Oklahoma", "Oregon", "Pennsylvania", "Rhode Island", "South Carolina", "South Dakota", "Tennessee", "Texas", "Utah", "Vermont", "Virginia", "Washington", "West Virginia", "Wisconsin", "Wyoming");
                    for ($counter = 1; $counter < 51; $counter ++) 
                    {
                       echo"<option>$states_of_the_USA[$counter]</option>"; 
                    }
                    echo "</select>";
                ?>
             [color=red] Home Phone: <input type="text" name="message[]" size="12" maxlength="15" /><br >[/color]
            
    
           [color=blue] Cell Phone: <input type="text" name="message[]" size="12" maxlength="15" />[/color]
                
                <label for="subject"><b>Subject:</b></label>
    
                <input type="text" id="subject" name="subject" size="40"  /></p>
                
                <label for="message"><b>Story (200 - 600 words):</b></label>
    
                <textarea id="message" name="message" rows="18" cols="80"></textarea>
                
                <input name="submit" type='submit' value='Submit Form' /></p>
            
            {/exp:email:contact_form}

    I’m using the message array as the name and it’s not passing through. Any help would be appreciated.

  • #2 / Oct 07, 2008 11:12am

    Boyink!

    5011 posts

    For anything past the simplest of contact forms, I’d really suggest the FreeForm module from Solspace.

  • #3 / Oct 07, 2008 12:32pm

    Wired

    181 posts

    Thanks man… I found that form last night. Hopefully it’ll do the trick.

  • #4 / Oct 07, 2008 2:04pm

    Lisa Wess

    20502 posts

    Just as a note, you do have a message in there without the [].  When using the array, *every* message must have it, or the one without will over-ride the others.

    <textarea id="message" name="message" rows="18" cols="80"></textarea>

    should be

    <textarea id="message" name="message[]" rows="18" cols="80"></textarea>
  • #5 / Oct 07, 2008 9:38pm

    Wired

    181 posts

    Yea I notice that last night. A newb mistake on my part. Thank you!

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases