Forums

Submit + Message + Redirect with delay

denilo 10 Feb, 2018
Hi there,
I´m unfortunately totally new in working with CMS and I need help in creating the following:
I want that after the user has pressed the submit button, that the success message appears (so far not a problem), but I want that the page also stays at the contact form module, so that the user immediately can recognize that the message was sent. Furthermore I would like to have then a redirection after 5 seconds to a web-address, so that the highlighted part of the address (see below) will disappear.

I have searched in this forum and also found some solutions with custom php code, I have tried to follow the solution steps, but I always get error messages ...

My problem is, when I only have a success message after submitting the form, the page will jump to the top and the user first has to scroll back to the Chronoform module to see the message AND the following stays in the web-address:
http://www.xyz.de/?chronoform=kontaktformular-copy&event=submit
I want that this part of the address will disappear, but when I include a redirection, the redirection will be performed immediately after submitting and furthermore there will be no success message😟

Is there an easy solution that can be used by a noob like me?

I have tried a lot of different Joomla forms and after I have found Chronoforms I was very impressed, especially in regards to the big customization possibilities ... only the above mentioned issue currently prevents me in buying a license ...

Big thanks in advance for your support!

[Joomla 3.8.5, Chronoforms v6]
Max_admin 10 Feb, 2018
1 Likes
Hi denilo,

If you do not want the address to change after you send the form then please open the "Display section" action settings and enable the "Ajax" feature, that should show the form results in the same place of the form, you may also need to open the "Message" action and set the position to "body".

to wait 5 second then redirect will need a custom javascript code, please try the ajax first and let me know how do you want the form to perform after that.

Best regards
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
denilo 11 Feb, 2018
Hello,
Thank you very much - the first issue is solved! When the form will now be submitted, I receive the success message in the module, the page stays at the same position and also the address will not change😀

I really hope that the delayed redirection can also be implemented with your help ...

Okay now the user receives the success message at the same position ... what has to be done that he will now be redirected after additional 5 seconds?

Thank you very very much, sour support is much appreciated!
Max_admin 11 Feb, 2018
Answer
1 Likes
Hi denilo,

Please try to use the following code inside a "Custom code" action in the form "submit" event:
<script>
setTimeout(function () {
window.location.href = "blog.html"; //will redirect to your blog page (an ex: blog.html)
}, 5000); //will call the function after 5 secs.
</script>
Please change the code to your liking!

Best regards
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.