Hello,
I was testing ExpressionEngine long time ago and there’s one thing I do not like. I believe it’s called “Message templates”.
Is it possible to create ajax messages?
For example: When I fill out contact form and click submit, a success message above contact form would appear?
Not sure what all you want to do exactly, but The example you give does not require AJAX really…
Below is an example from one of mine which DOES post the message and reload the page (although if it can be done this way then it can certainly be done via AJAX - maybe someone else has an example of that)
In the example below:
Contact Form:
{if segment_2 == 'thank-you'}
<div class="alert alert-success" role="alert">
Thank you, your Email has been sent. Someone will get back to you soon.
</div>
{/if}
{exp:email:contact_form redirect="return" return="contact/thank-you" replyto="yes" recipients="" charset="utf-8"}
YOUR EMAIL FOR CONTENT
{/exp:email:contact_form}
In the case of the example above, it simply refreshes the page and places the Success/Thank You message above the form, but you could replace the form entirely with your thank you message if you wanted to.
Hope that helps:
Russ
PS… More info in the Docs
Hello,
Can somebody clarify how the value inserted in the “return” field work? Where does it come from?
I followed the example above, putting return=”contact/thank-you” in a contact form (EE7), but I get an error message: “Error The page you requested was not found.”
Instead of refreshing the page adding the new segment (thank-you) to the url, the system looks for the “thank-you” page.
I tested the same with EE6, installed with the default theme.
In that case it works. The return value is set to “contact/thanks”. If I change it to “…/thank-you” or whatever it returns the page error as indicated before for EE7.
What am I missing?
Thanks Mario
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.