It breaks, but in a different way; I just get a ` where the form should be.
Interestingly, = is fine if I run the FormIt snippet uncached (without the !). But although the form displays, it doesn't send an email.
If it helps, I'm running the whole FormIt snippet and form within its own chunk.
Thanks,
David
Just curious: why not using a chunk for the message and call this chunk in &succesMessage ? Does that break your FormIt call also?
Codeplaza Webdesign: for professional websites at low cost
Same thing happens. Form doesn't display if I put = into the chunk.
-
☆ A M B ☆
- 24,524 Posts
FormIt itself doesn't do anything if the snippet call is cached; the first display of the page will show the form, but it gets cached at that point and the snippet tags are lost, so on form submit (the second page request, taken from the cache) nothing happens, since there's no snippet to process the POST sent along by the form.
The only way an error with FormIt will cause the form itself to not display is if the error causes the whole page to abort. You can display forms all day without any FormIt snippet at all.
Have you tried using an HTML entity instead of the = character?
discuss.answer
Hm, you could try it with a custom hook. Maybe this works?!
FormIt:
[[!FormIt? &hooks=`recaptcha,spam,email,mySuccessMsg` ... ]]
Snippet (mySuccessMsg):
<?php
$modx->setPlaceholder('mySuccessMsg','<h3 class="msg">Thank you for contacting us.</h3>');
return true;
?>
Placeholder (below FormIt tag):
sottwell: If I use = then I just get a ` (the rest of the page displays).
David Pede: The form wasn't displayed, but at least I didn't get a ` in its place.
Chris: I'd seen this suggestion elsewhere, but thought it seemed like overkill. It may well be, but it works. The quicker alternative was to put the h3 inside the form tag (there was only one), but I'm going to stick with the extra snippet implementation because I might need it for longer forms in the future.
Thanks,
David