Do you think that is possible to have a variable URL for redirect action?
...without using custom code...
...without using custom code...
Hi enzo-orsi,
Officially, no, but if you don't mind a little bit of work yes you can over-write the url using a Custom Code action before the ReDirect. Here's my test code:
Your code needs to make sure that what you set is a valid URL!
Bob
Officially, no, but if you don't mind a little bit of work yes you can over-write the url using a Custom Code action before the ReDirect. Here's my test code:
<?php
if ( !empty($form->data['radio1'] ) ) {
$url = 'http://'.$form->data['radio1'];
$form->actions_config[3]['url'] = $url;
}
?>
The important line is the $form->actions line. you need to replace the 3 there with the action ID of the ReDirect action 0 it's the number that shows up in the Setup Tab.
Your code needs to make sure that what you set is a valid URL!
Bob
Thank you very much Bob!
It is great.
Just two hints:
- I added a random URL in Redirect URL field in the event, otherwise I had error in the CF dashboard (because URL cannot be empty)
- I did something similar also for PayPal Redirect:
where 'xxx' is the ID of PayPal Redirect event.
It is great.
Just two hints:
- I added a random URL in Redirect URL field in the event, otherwise I had error in the CF dashboard (because URL cannot be empty)
- I did something similar also for PayPal Redirect:
$url_paypal_redirect = JUri::root() . 'index.php?option=com_chronoforms5&chronoform=MYFORM&event=ipn';
$form->actions_config[xxx]['return'] = $url_paypal_redirect ;
where 'xxx' is the ID of PayPal Redirect event.
This topic is locked and no more replies can be posted.