Hi Guys,
Im really sorry, very new to modx and making steady progress. Anyway, trying to get a basic form on my site working with FormIt, and am not getting very far. I’m basically trying to get sample form working, once this is wokring I can build up the additional fields I need. the code I have used so far is:
[[!FormIt?
&hooks=`spam,email,redirect`
&emailTpl=`MyEmailChunk`
&emailTo=`
[email protected]`
&redirectTo=`thankyou.html`
&validate=`name:required, email:email:required, subject:required, text:required:stripTags, numbers:required, colors:required` ]]
<h2>Contact Form</h2>
[[!+fi.error.error_message:notempty=`
<p>[[!+fi.error.error_message]]</p>
`]] <form class="form" action="[[~[[*id]]]]" enctype="application/x-www-form-urlencoded" method="post"><input name="nospam:blank" type="hidden" /> <label for="name">Name: <span class="error">[[!+fi.error.name]]</span> </label><input id="name" name="name" type="text" value="[[!+fi.name]]" /> <label for="email">Email: <span class="error">[[!+fi.error.email]]</span> </label><input id="email" name="email" type="text" value="[[!+fi.email]]" /> <label for="subject">Subject: <span class="error">[[!+fi.error.subject]]</span> </label><input id="subject" name="subject" type="text" value="[[!+fi.subject]]" /> <label for="text">Message: <span class="error">[[!+fi.error.text]]</span> </label><textarea id="text" cols="55" rows="7" name="text">[[!+fi.text]]</textarea> <label>Numbers:[[+fi.error.numbers]] <select name="numbers"> <option selected="selected">Select an option...</option> <option value="one">One</option> <option value="two">Two</option> <option value="three">Three</option></select> </label><label>Colors:[[!+fi.error.colors]] <input name="colors[]" type="hidden" /> </label>
<ul>
<li><label><input name="colors[]" type="checkbox" value="red" /> Red</label> </li>
<li><label><input name="colors[]" type="checkbox" value="blue" /> Blue</label> </li>
<li><label><input name="colors[]" type="checkbox" value="green" /> Green</label> </li>
</ul>
<br class="clear" />[[!+FormIt.recaptcha_html]] [[!+fi.error.recaptcha]] <br class="clear" />
<div class="form-buttons"><input type="submit" value="Send Contact Inquiry" /> </div>
</form>
I have created a chunk and called it "MyEmailChunk"
with the following code
This is the Formit Email Chunk.
[[+name]] ([[+email]]) Wrote:
[[+text]]
Any advice would be greatly appreciated