The instructions from Mary’s Pad didn’t work for me out of the box either so... here’s what I’m using now, hopefully people can work from it if they’re having issues.
1. FormIt call (this should be in a chunk which gets called right before your form HTML):
[[!FormIt?
&submitVar=`submit`
&hooks=`email`
&emailTpl=`doc_uploadtpl`
&emailSubject=`Work`
&emailTo=`[email protected]`
&emailReplyTo=`contact_email`
&validate=`
contact_person:minLength=^2^,
contact_email:email:required,
contact_company:minLength=^3^,
&successMessage=`Thanks for your submission!`
]]
2. Email template, also in a chunk, this should not cause problems and can be just about anything. Just make sure it has the same name as the &emailTpl in your FormIt call (above).
Company: [[+contact_company]]<br />
Contact: [[+contact_person]]<br />
Email: [[+contact_email]]<br />
3. The form HTML (make sure to call your FormIt chunk just above the start of the form!)
<form id="doc_upload" class="cmxform" method="post" action="[[~[[*id]]]]" enctype="multipart/form-data">
<h2>Some Title</h2>
<p>Some subtitle</p>
<!-- This makes the upload button -->
<div>
<input id="document" name="document" class="required" type="file" value="[[!+fi.document]]" />
<div class="error">[[!+fi.error.document]]</div>
</div>
<!-- This makes other form fields -->
<div>
<label for="contact_person">Contact Person: </label>
<input id="contact_person" name="contact_person" size="30" class="required" minlength="2" value="[[!+fi.contact_person]]" />
<div class="error">[[!+fi.error.contact_person]]</div>
<br />
<label for="contact_email">Contact Email: </label>
<input id="contact_email" name="contact_email" size="30" class="required email" value="[[!+fi.contact_email]]" />
<div class="error">[[!+fi.error.contact_email]]</div>
<br />
<label for="contact_company">Company Name: </label>
<input id="contact_company" name="contact_company" size="30" class="required" minlength="3" value="[[!+fi.contact_company]]" />
<div class="error">[[!+fi.error.contact_company]]</div>
</div>
<!-- This makes the submit button -->
<div class="form_area">
<input name="submit" class="submit" type="submit" value="Send"/>
</div>
</form>
Hope that helps, and please let me know if it doesn’t, I modified it somewhat to be more general so who knows what typos might have slipped in...