I'm having an issue with Formit processing a form with attachments. The form submitted just fine until I enable the attachment feature.
MODx: 2.2.0pl
FormIt: 2.0.3
Snippet & HTML
[[FormIt?
&submitVar=`submit`
&hooks=`spam,email,redirect`
&validate=`name:required,email:required`
&emailTpl=`quick-contact-report`
&emailTo=`[[++form_emails]]`
&emailSubject=`[[++site_name]]Quick Contact Form Submission`
&redirectTo=`89`
]]
<form id="quick_contact" action="[[~[[*id]]]]" method="post" enctype="multipart/form-data">
<input type="hidden" name="nospam:blank" value="" />
<h4>Do You Have A Question?</h4>
<p class="req">* Indicates Required Fields</p>
<fieldset>
[[!+fi.validation_error_message]]
<label for="name">Your Name</label>
<input id="qc-contact-name" type="text" placeholder="Name*" name="name" />
<label for="email">Your Email</label>
<input id="qc-contact-email" type="email" placeholder="Email*" name="email" />
<label for="phone">Your Phone</label>
<input id="qc-contact-phone" type="tel" placeholder="Phone" name="phone" />
<label for="comments">Comments</label>
<textarea id="qc-contact-comment" name="comments" rows="5" cols="19" placeholder="Question or Comments"></textarea>
<input type="file" name="attachment" id="attachment" value="[[!+fi.attachment]]"/>
</fieldset>
<input type="submit" name="submit" class="btn btn-inverse" value="SUBMIT" />
</form>
<!-- /quick-contact -->
Sal Baldovinos
SEO & DIGITAL MARKETING
ARIEL DIGITAL | Maximize Your Potential
www.arieldigitalmarketing.com
-
- 5,888 Posts
I think you will need to call formit uncached:
That did the trick. The only issue is that I'm using an output filter to show/hide the form
Sidebar Chunk
[[*id:isnot=`80`:then=`[[$quick-contact]]`:else=``]]
Quick Contact is the chunk code I already pasted. When it's called [[!FormIt? it breaks the output filter and no longer displays at all.
Sal Baldovinos
SEO & DIGITAL MARKETING
ARIEL DIGITAL | Maximize Your Potential
www.arieldigitalmarketing.com
-
- 5,888 Posts
perhaps its better to create a radio-TV with inputOptions:
show Form==[[$quick-contact]]||Hide Form==[[$emptyChunk]]
default value:
check 'Hide Form' on page 80
and replace the outputfilter with the TV-tag of this TV
or you can try to use the If-snippet
I've used the TV method in the past, so if all else fails, I'll go that route. I'll try If too.
Sal Baldovinos
SEO & DIGITAL MARKETING
ARIEL DIGITAL | Maximize Your Potential
www.arieldigitalmarketing.com
Used If snipped and everything checks out great! Thanks for the assistance! @Bruno17
For Reference:
[[!If?
&subject=`[[*id]]`
&operator=`EQ`
&operand=`80`
&then=``
&else=`[[$quick-contact]]`
]]
And using the FormIt uncached
Sal Baldovinos
SEO & DIGITAL MARKETING
ARIEL DIGITAL | Maximize Your Potential
www.arieldigitalmarketing.com