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?