Hi,
On a Joomla 2.5 current site using Chronoforms 4.0.1. I have a single form with 5 pages. I have 2 problems.
[list=]1. The Event Switcher is not working when I want to redirect to a different page.
2. I can't get the Custom Code on page 5 to modify the input fields on that page based on data entered from page 4.[/list]
Problem 1
I have a single radio button on the first page that either gets Yes or No selected, called broker. In the Show HTML for the first page I have it display page 1 and on submit go to page 2.
Then on page 2 I have added an Event Switcher [GH] with this code:
For Event A I have a Show HTML to display page 2 and on submit go to Page 3, this works.
For Event B I have a Redirect User to /thanks, which has a menu item for /thanks and then a Show Stopper.
When I test this, if I click the Yes button, it shows Page 2 form fields, but if I press No it still goes to page 2 but I get a blank page instead of being redirected to /thanks page. The URL is: /index.php?option=com_chronoforms&chronoform=formname&event=Page_2&cf_sid=xxx it goes to. I can't figure out why it doesn't do the redirection.
Problem 2
On page 3 of the form I have 4 form fields, then you go to page 4. On page 4 what I need to do is take the values filled in on page 3, do some calculations and show the results. So, what I did was add 3 form fields on page 4 and then am trying to get the results of the calculations to show in those form fields. ( It would be better if I could just add HTML to the page above some form fields that show the results of the calculation. But I don't know how to do that either. )
So on Page 4 I have the Multi Page, then a Custom Code and then the Show HTML. It is in the Custom Code that I am doing the calculations and trying to put the values in to the form fields. But it is like the Custom Code is not being executed as the form fields are always blank. Here is what I have in the Custom Code:
The 'In calculation of savings' does not show on the frontend. The form field called current_payments and new_payments are always blank.
Can you please help solve these issues? Let me know if you need to see the form.
Thank you.
On a Joomla 2.5 current site using Chronoforms 4.0.1. I have a single form with 5 pages. I have 2 problems.
[list=]1. The Event Switcher is not working when I want to redirect to a different page.
2. I can't get the Custom Code on page 5 to modify the input fields on that page based on data entered from page 4.[/list]
Problem 1
I have a single radio button on the first page that either gets Yes or No selected, called broker. In the Show HTML for the first page I have it display page 1 and on submit go to page 2.
Then on page 2 I have added an Event Switcher [GH] with this code:
<?php
$jinput = JFactory::getApplication()->input;
$broker = $jinput->getString('broker', '', 'post');
if ($broker == 'Yes') {
return 'event_a';
} else {
return 'event_b';
}
?>
For Event A I have a Show HTML to display page 2 and on submit go to Page 3, this works.
For Event B I have a Redirect User to /thanks, which has a menu item for /thanks and then a Show Stopper.
When I test this, if I click the Yes button, it shows Page 2 form fields, but if I press No it still goes to page 2 but I get a blank page instead of being redirected to /thanks page. The URL is: /index.php?option=com_chronoforms&chronoform=formname&event=Page_2&cf_sid=xxx it goes to. I can't figure out why it doesn't do the redirection.
Problem 2
On page 3 of the form I have 4 form fields, then you go to page 4. On page 4 what I need to do is take the values filled in on page 3, do some calculations and show the results. So, what I did was add 3 form fields on page 4 and then am trying to get the results of the calculations to show in those form fields. ( It would be better if I could just add HTML to the page above some form fields that show the results of the calculation. But I don't know how to do that either. )
So on Page 4 I have the Multi Page, then a Custom Code and then the Show HTML. It is in the Custom Code that I am doing the calculations and trying to put the values in to the form fields. But it is like the Custom Code is not being executed as the form fields are always blank. Here is what I have in the Custom Code:
<?php
echo 'In calculation of savings';
$jinput = JFactory::getApplication()->input;
$volume = $jinput->getString('volume', 0, 'post');
$royalty = $jinput->getString('royalty', 0, 'post');
$commission = $jinput->getString('commission', 0, 'post');
$expenses = $jinput->getString('expenses', 0, 'post');
$form->data['current_payments'] = 1000;
$form->data['new_payments'] = $expenses;
?>
The 'In calculation of savings' does not show on the frontend. The form field called current_payments and new_payments are always blank.
Can you please help solve these issues? Let me know if you need to see the form.
Thank you.