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.

EE 2.0 Beta | Contact Form

May 06, 2010 8:03pm

Subscribe [2]
  • #1 / May 06, 2010 8:03pm

    guruabyss

    18 posts

    I just finished creating and skinning my contact form and now I’m ready to add the tags needed to have EE take control. I have some questions regarding some of the tages EE 2.0 uses. Here is my code:

    {exp:email:contact_form user_recipients="false" required="name|email|subject|message" return="http://www.example.com/index.php" recipients="[email protected]" charset="utf-8"} 
                        
                            <div class="formInfo">* Required Feilds</div>
                        
                            <div class="formHolder"><label class="bluArrow" for="from">name *</label><input type="text" name="name" class="text" maxlength="20" /></div>
                        
                            <div class="formHolder"><label class="bluArrow" for="email">email *</label><input type="text" name="from" class="text" maxlength="20" /></div>
                            
                            <div class="formHolder"><label class="bluArrow" for="subject">subject *</label><input type="text" name="subject" class="text" maxlength="20" /></div>
                            
                            <div id="messageHolder"><label id="bluBubble" for="message">message *</label><textarea name="message" class="text" maxlength="250"></textarea></div>
                            
                            <div class="formHolder"><input type="submit" name="submit" value="submit" id="submit" /><div id="infoBox">This will be submitted to <b>[email protected]</b></div></div>
                            
                        
    {/exp:email:contact_form}

    So after looking at the wiki (http://expressionengine.com/public_beta/docs/modules/email/contact_form.html#par_user_recipients) and reading some of the forum posts I’m still a little confused on the required bit. Looks like the required in the wiki isn’t what I have in my mind as “required fields”. After digging around the forums I found a post from 2004-05 (http://ellislab.com/forums/viewthread/11619/). I don’t know if that holds any relevance to EE 2.0 but I need to make sure all the fields I have in my code are required for the submit process to go through.

    So in my code above, will having:

    required=“name|email|subject|message”

    work?

    If the user lets say only fills out 3 of the 4 fields where is the EE tag that lets the user know they needs to fill out all required fields? I was thinking of placing the error message in:

    <div class="formInfo">* Required Feilds</div>

    right next to the “* Required Feilds”

    Also for the textarea I want to limit the numbers of characters (a visual representation like in the EE forums). How would I go about adding that in my code?

  • #2 / May 07, 2010 1:03am

    Nutmeg

    111 posts

    You could use CSS to contain the textarea with this

    textarea {resize: none;}

    , instead of limiting the number of characters:

    Did you test your form?

  • #3 / May 07, 2010 1:20am

    guruabyss

    18 posts

    Not yet, just want to make sure my concept is correct before making the drive.

  • #4 / May 07, 2010 11:07pm

    guruabyss

    18 posts

    can anyone who has done a contact form before lend a hand?

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

ExpressionEngine News!

#eecms, #events, #releases