Were rebuilding a website in Evolution for a client and thus need to use Evolution.
Ive set up a form for their brochure download and newsletter signup.
The issue is i need to send them to a different thank you page if they choose a printed brochure (based on a checkbox)
So far i have followed this thread:
http://forums.modx.com/index.php?topic=32812.0.
My form and snippets are as follows:
<p class="error">[+validationmessage+]</p>
<form action="[~[*id*]~]" method="post" enctype="multipart/form-data" id="ContactForm">
<input name="formid" type="hidden" value="ContactForm" />
<ul>
<li>
*Indicates required fields
</li>
<li>
<label for="cfName">Your First name*:</label>
<input name="firstname" id="cfFirstName" class="text" type="text" eform="Your First Name::1:" />
</li>
<li>
<label for="cfSurName">Your Surname*:</label>
<input name="surname" id="cfSurName" class="text" type="text" eform="Your Surname::1:" />
</li>
<li>
<label for="cfEmail">Your Email Address*:</label>
<input name="email" id="cfEmail" class="text" type="text" eform="Email Address:email:1" />
</li>
<li>
<label for="cfHouseNo">House Name/Number:</label>
<input name="houseno" id="cfHouseNo" class="text" type="text" eform="Your House Number::0" />
</li>
<li>
<label for="cfStreet">Street:</label>
<input name="street" id="cfStreet" class="text" type="text" eform="Your Street Name::0" />
</li>
<li>
<label for="cfTown">Town:</label>
<input name="town" id="cfEmail" class="text" type="text" eform="Your Town::0" />
</li>
<li>
<label for="cfCounty">County:</label>
<input name="county" id="cfCounty" class="text" type="text" eform="Your County::0" />
</li>
<li>
<label for="cfPostcode">Postcode:</label>
<input name="postcode" id="cfPostcode" class="text" type="text" eform="Your Postcode::0" />
</li>
<li>
<label for="cfCountry">Country:</label>
<input name="country" id="cfCountry" class="text" type="text" eform="Your Country::0" />
</li>
<li> <strong> Note:</strong> full address required for posted brochure requests! </li>
<li>
<label for="cfTelNo">Daytime Telephone:</label>
<input name="telno" id="cfTelNo" class="text" type="text" eform="Your Telephone Number::0" />
</li>
<li>
<label for="cfNeeds">Particular Needs:</label>
<textarea name="needs" rows="5" id="cfNeeds" eform="Particular Needs:textarea:0"></textarea>
</li>
<li>
<label for="cfByPost">Please send me a printed brochure by post:</label>
<input type="checkbox" value="1" id="bypost" name="bypost" eform="Brochure By Post::0" />
</li>
<li>
<label for="cfSubscribe">Subscribe to e-mail newsletters:</label>
<input type="checkbox" value="1" id="subscribe" name="subscribe" eform="Subscribe to Newsletters?::0"/>
</li>
<li>
<input type="submit" name="contact" id="cfContact" class="button" value="Submit" />
</li>
</ul>
</form>
thankYouRedirect
<?php
function onMailSentEvent(&$fields){
global $modx;
switch($fields['bypost']){
case '1':
$id = 216;
break;
default:
$id = 215;
}
$modx->sendRedirect($modx->makeUrl($id, '', '', 'full'));
}
?>
And Eform call:
[!eForm? &formid=`ContactForm`&to=`[email protected]` &tpl=`BrochureDL` &report=`BrochureDLReport` &vericode=`0` &subject=`Brochure Download` &eFormOnBeforeMailSent=`eForm2db` &eFormOnMailSent=`onMailSentEvent` !]
But everythime i submit the form it just goes to a blank page - the form is processed, as it submits to the database via eform2db.
Any ideas?