Thanks for all your help guys, I’ve done a lot more reading into FormIt and I’ve decided this is the best option for me once I learn it inside and out, so I’ll just need to tough it out until I can get my hands on it entirely.
Currently, I’m running into one major problem. I have 1 form that is static to all pages (its in the head section of my template, before [[*content]], so it shows on all pages that use that template.
On ONE page however, I need to have 2 forms, and I’m running into trouble with &submitVar=. The FormIt documentation isn’t very specific as to WHAT needs to be set for &submitVar=. I’ve tried setting IDs and classes to portions of the form and put that in submitVar, but it just loops back to the page again with blank form instead of going to the "thank you" page.
Below is the code I am using (with my email removed, obviously), it’s basically just the Generic FormIt example that you can get from the documentation. Any help in figuring out how submitVar works is greatly appreciated:
[[!FormIt?
&hooks='spam,email,redirect'
&emailTpl='MyEmailChunk'
&emailTo='[email protected]'
&redirectTo='16'
&submitVar='form2'
&validate='name:required,
email:required,
subject:required,
text:required:stripTags,
numbers:required,
colors:required'
]]
<form action="[[~[[*id]]]]" method="post" class="form2">
<input type="hidden" name="nospam:blank" value="" />
<label for="name">
Name:
<span class="error">[[+fi.error.name]]</span>
</label>
<input type="text" name="name" id="name" value="[[+fi.name]]" />
<label for="email">
Email:
<span class="error">[[+fi.error.email]]</span>
</label>
<input type="text" name="email" id="email" value="[[+fi.email]]" />
<label for="subject">
Subject:
<span class="error">[[+fi.error.subject]]</span>
</label>
<input type="text" name="subject" id="subject" value="[[+fi.subject]]" />
<label for="text">
Message:
<span class="error">[[+fi.error.text]]</span>
</label>
<textarea name="text" id="text" cols="55" rows="7" value="[[+fi.text]]">[[+fi.text]]</textarea>
<label>
Numbers:[[+fi.error.numbers]]
<select name="numbers" value="[[+fi.numbers]]">
<option value="">Select an option...</option>
<option value="one" [[!+fi.numbers:FormItIsSelected=`one`]]>One</option>
<option value="two" [[!+fi.numbers:FormItIsSelected=`two`]]>Two</option>
<option value="three" [[!+fi.numbers:FormItIsSelected=`three`]]>Three</option>
</select>
</label>
<label>
Colors:[[+fi.error.colors]]
<input type="hidden" name="colors[]" value="" />
</label>
<ul>
<li>
<label><input type="checkbox" name="colors[]" value="red" [[!+fi.colors:FormItIsChecked=`red`]] /> Red</label>
</li>
<li>
<label><input type="checkbox" name="colors[]" value="blue" [[!+fi.colors:FormItIsChecked=`blue`]] /> Blue</label>
</li>
<li>
<label><input type="checkbox" name="colors[]" value="green" [[!+fi.colors:FormItIsChecked=`green`]] /> Green</label>
</li>
</ul>
<br class="clear" />
[[!+formit.recaptcha_html]]
[[!+fi.error.recaptcha]]
<br class="clear" />
<div class="form-buttons">
<input type="submit" id="environment-submit" value="Send Contact Inquiry" />
</div>
</form>
Can someone (using the code example above) please show me the proper input value for SubmitVar? Thank you very much!