Thank You page on Submit - Classic Mode

  • covumc
  • Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 14
  • Thank you received: 0

covumc created the topic: Thank You page on Submit - Classic Mode

When in classic mode, how do I redirect to a "Thank you" page after the validate and submit? The pizza example does this, but just cutting and pasting the custom script there isn't working (yes, I remembered to change the name of the page to the second page in my form.)

Is there a "piece" required or have I not got the custom script correct?
#15051
  • Posts: 113
  • Karma: 5
  • Thank you received: 0

goshmac replied the topic: Re: Thank You page on Submit - Classic Mode

Hi!

Please generate your own script in your submit-button!!! And then only paste this:

if (status != 0) {
alert(
"Sorry, but submission of you entries unfotunately failed.\n"+
"We will check this problem and hope on your understanding.\n"+
"You will be redirected to the home page now."
);
ff_returnHome();
} else
ff_switchpage(ff_getPageByName('pst_picture')); // thank you

Here just enter the name of the page like you already did.

greetings
matthias
#15095
  • covumc
  • Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 14
  • Thank you received: 0

covumc replied the topic: Re: Thank You page on Submit - Classic Mode

Thanks for you reply.

Ok, Here is what I have:

In the "Submit Button" field, Script tab - Action - Library: ff_validate_submit.

When I click on the form name and go to Script tab - Submit - Custom I've pasted your code (which is basically the same code as the pizza example):

if (status != 0) {
alert(
"Sorry, but submission of you entries unfotunately failed.n"+
"We will check this problem and hope on your understanding.n"+
"You will be redirected to the home page now."
);
ff_returnHome();
} else
ff_switchpage(ff_getPageByName('fru_thankyou')); // thank you

My thank page is page 2 and the first field name = fru_thankyou. Is there a way to actually name the page?

I also tried changing ff_switchpage(ff_getPageByName('fru_thankyou')) to ff_switchpage(2), but that didn't work either.

The form is actually submitted successfully and an empty form is returned, but the thank you page is not displayed.

This is frustrating because I know I'm close. It's probably some small error somewhere.

Any help will be greatly appreciated!
#15105
  • Posts: 113
  • Karma: 5
  • Thank you received: 0

goshmac replied the topic: Re: Thank You page on Submit - Classic Mode

my fault :(

ok..in your form->Submit->Custom you have to first click on 'generate code' or something like that...should look like:

function ff_yourFormName_submitted(status)
{

} // some text here

Then paste the above mentioned code in this:

function ff_yourFormName_submitted(status)
{
if (status != 0) {
alert(
"Sorry, but submission of you entries unfotunately failed.n"+
"We will check this problem and hope on your understanding.n"+
"You will be redirected to the home page now."
);
ff_returnHome();
} else
ff_switchpage(ff_getPageByName('fru_thankyou')); // thank you
} // some text here

The function-part(function ff_yourFormName_submitted(status){...}) is very important!

If this is done and you couldn't get the thank you page, try to insert alert('testalert'); in this script to test if your script is fired when form is submitted ;)

hope it helps!!

matthias
#15107
  • covumc
  • Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 14
  • Thank you received: 0

covumc replied the topic: Re: Thank You page on Submit - Classic Mode

Perfect! Thanks!
#15109
  • Posts: 113
  • Karma: 5
  • Thank you received: 0

goshmac replied the topic: Re: Thank You page on Submit - Classic Mode

you are welcome :)
#16319
Moderators: ForumSupporttomeperica
Time to create page: 0.065 seconds

New Icon Packs Category!

Crosstec is now offering icon packs.

If you are a paying subscriber, icon packs are automatically added to your account.

Check out our icon packs page!

Live Support Chat Opened!

Join our Discord chat here to receive live support and talk directly to the team!

Summer Sale!

50% discount on all of our extension subscription plans, templates and icon packs!

Get Your Subscription Here

News and Updates

Get informed about new downloads, updates and more in our News and Updates newsletter.

All Extensions Subscription

Get 1 year access to all of our current and future products and 1 year of professional support -- 99 for just 49! (Summer Sale)

No support per domain or website installation limits! Includes all of our current and future Joomla!® extensions, Joomla!® templates for the duration of your membership. This means, by purchasing an All Extensions Subscription you'll have it all covered!

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!

Live Support Chat Opened!

Join our Discord chat here to receive live support and talk directly to the team!

Community Reward

Help us to create new extensions and plugins! With only $5 you help us a lot and get unlimited download access to all of our products, professional support and even more. Get your reward now!

Read More Here