TOPIC:

Re: Redirect page after user hits submit 5 years 10 months ago #166144

  • tomeperica's Avatar
  • tomeperica
  • Offline
  • User is blocked
  • User is blocked
  • Posts: 6478
  • Karma: 170
  • Thanks: 674
Hey there,

I made an example again, form called Redirection Example. Note this -> do not save the form because then code in End Submit Script will be reset to default, so when you made all changes on your form save it and then go to End submit Script and enter the code there, that's the workaround for this solution you need.

This is the code from form I made:
function ff_example_submitted(status, message) {
	if(status==0){
		ff_switchpage(2);
		JQuery(document).ready(function () {
			    window.setTimeout(function () {
			        location.href = "http://ndo.leovanderhoek.nl/index.php/2014-08-30-10-07-59/afmelden-web-app";
			    }, 5000);
			});
	}else {
		alert(message);
	}
} // ff_example_submitted

Regards
Regards,
Tome
==========================================
Need to renew Pro Support?
Buy Here!
==========================================
Satisfied?
Consider a membership!
==========================================
Like us on Facebook
==========================================
Support Crosstec and get ALL EXTENSIONS and professional support for just $5
Here!

Please Log in or Create an account to join the conversation.

Re: Redirect page after user hits submit 5 years 10 months ago #166150

  • hoekbrwr
  • Offline
  • Senior Breezer
  • Senior Breezer
  • Posts: 96
  • Thanks: 5
OK this is working for the time being. As I am the only editor on this form I have to remember to keep putting back this code every time I make some other changes to my form. I now understand that I do not have to regenerate my form when data is changed? When content of select lists change for example I do not have to regenerate form?
I think I have another solution. I put a script inside the text of Th.Y page and use ff_currentpage == 2 in this case as an extra condition to trigger the timer. This works fine!!!. It is not the nicest solution but it works without any restrictions once you got it all running.
I use Sourcerer to put in code into text fields. Otherwise Joomla is filtering out the script again!
The code I used looks like this:
Copy this into the text page, not in the <>(code page, otherwise the editor will start converting it and it becomes rather difficult to read. So copy it from some code editor into the text area. Change the functions for other things to do.
{source}
function ff_inschrijven_ndo_submitted(status, message) {
	if (status == 0 && ff_currentpage == 2) {	
		window.setTimeout(function () {
			location.href = "http://www.example.com";
		}, 5000);
	} 
}
{/source}

Change the name of the function according to the formname and theredirection page as necessary.

A final solution should be coming when there is a new release of BF that solves the the behaviour of the checkbox to use Last page as ThankYou page and the relation to the Custom code field(I am at version 1.8.7 build 884).

Unfortunately it does not work always. In this way you end up with 2 identical function declarations. If you are lucky your non standard ff_formname_submitted function is the last one declared then it works. If it is the standard function declaration then it does not function. Then use the solution as proposed by BF and start hoping this problem will be solved swiftly(no Saving of form after input of Custom code).

Please Log in or Create an account to join the conversation.

Last edit: Post by hoekbrwr.

Re: Redirect page after user hits submit 5 years 10 months ago #166151

  • tomeperica's Avatar
  • tomeperica
  • Offline
  • User is blocked
  • User is blocked
  • Posts: 6478
  • Karma: 170
  • Thanks: 674
Ok let us know the result.

Regards
Regards,
Tome
==========================================
Need to renew Pro Support?
Buy Here!
==========================================
Satisfied?
Consider a membership!
==========================================
Like us on Facebook
==========================================
Support Crosstec and get ALL EXTENSIONS and professional support for just $5
Here!

Please Log in or Create an account to join the conversation.

Re: Redirect page after user hits submit 5 years 10 months ago #166152

  • macedvisioned's Avatar
  • macedvisioned
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Forms specialist
  • Posts: 70
  • Thanks: 0
Hello,

I also tried to use the redirect script but I got a strange parse error. which shows up for a few seconds but it will not work.

I have 3 forms in the website:

kenniscentrumbos.nl/vacatures/

It must redirect to kenniscentrumbos.nl/vacatures/bedankt/

I use the following script piece:

function ff_vacatures_submitted(status, message) {
if (status == 0 && ff_currentpage == 2) {
window.setTimeout(function () {
location.href = "kenniscentrumbos.nl/vacatures/bedankt/";
}, 5000);
}
}

My formname is vacatures.

Can you say what I am doing wrong.

Regards,

Ed Boon
visioned.net
Ed Boon
visioned.nl
Forms specialist

Please Log in or Create an account to join the conversation.

Last edit: Post by macedvisioned. Reason: wrong script added

Re: Redirect page after user hits submit 5 years 10 months ago #166153

  • tomeperica's Avatar
  • tomeperica
  • Offline
  • User is blocked
  • User is blocked
  • Posts: 6478
  • Karma: 170
  • Thanks: 674
@macedvisioned
Hey there,

try to enter this code in Your Form -> Advanced tab -> More options -> Submit pieces -> End Submit -> Custom radio button:
$this->execPieceByName('ff_InitLib');
header('Location: http://kenniscentrumbos.nl/vacatures/bedankt/');
exit;

Let us know if that worked for you.

Regards
Regards,
Tome
==========================================
Need to renew Pro Support?
Buy Here!
==========================================
Satisfied?
Consider a membership!
==========================================
Like us on Facebook
==========================================
Support Crosstec and get ALL EXTENSIONS and professional support for just $5
Here!

Please Log in or Create an account to join the conversation.

Last edit: Post by tomeperica.

Re: Redirect page after user hits submit 5 years 10 months ago #166161

  • macedvisioned's Avatar
  • macedvisioned
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Forms specialist
  • Posts: 70
  • Thanks: 0
Hi,

Thanks this works. I forgot the 3rd line.

Regards,

Ed Boon
Ed Boon
visioned.nl
Forms specialist

Please Log in or Create an account to join the conversation.

Moderators: ForumSupport
Time to create page: 0.058 seconds

BreezingForms Pro 1.4.7 for WordPress Released!

Available in the membership section.

September Discount!

Massive discounts on all subscriptions!

Get Your Subscription Here

Quick Links

Downloads

BreezingForms

ContentBuilder

BreezingCommerce

Templates

Documentation

BreezingForms

ContentBuilder

BreezingCommerce

Apprendre BreezingForms (French Community)

Apprendre et maîtriser BreezingForms par des tutoriels et exemples, le tout en français

breezingforms.eddy-vh.com

Questions et réponses sur les forums de l'AFUJ

AFUJ

Special Offer

Summer Sale! All subscriptions at a special price!

Includes prio support, all of our current and future Joomla!® extensions and Joomla!® templates for the duration of your membership.

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!