Hi,
I have a form with some input elements and some formatted text elements. I am able to tweak the input elements with php code in a custom handler for the on load event (using $form->data['...']). I would also like to tweak some formatted text elements (based on the logged in user, so it has to be done at run time). Is there a way to modify formatted text elements using php in a custom handler for the on load event?
Thanks
Jimmy
I have a form with some input elements and some formatted text elements. I am able to tweak the input elements with php code in a custom handler for the on load event (using $form->data['...']). I would also like to tweak some formatted text elements (based on the logged in user, so it has to be done at run time). Is there a way to modify formatted text elements using php in a custom handler for the on load event?
Thanks
Jimmy
(I chose Chronoforms v3, but should have chosen Chronoforms v4; no way to change that?)
Hi Jimmy,
ChronoForms v3 doesn't run on Joomla 3 as far as I know so I'm not sure what you are using. You should probably download and install CFv5
You can use PHP in a Custom Code element to alter the values, just make sure that you save the final value back to an entry in the $form->data[''] array so that you can use it in the email template.
Bob
ChronoForms v3 doesn't run on Joomla 3 as far as I know so I'm not sure what you are using. You should probably download and install CFv5
You can use PHP in a Custom Code element to alter the values, just make sure that you save the final value back to an entry in the $form->data[''] array so that you can use it in the email template.
Bob
Thank you for the reply. I am indeed using Chronoforms v4 (I wanted to change the produce I selected in the original message but could not figure out why. Anyway, minor detail).
formatted text elements don't seem to show up in $form->data[''], as far as I can tell? I did a print_r on $form, and it's rather large, so perhaps I am missing something. I tried (all I need is to replace a value with something else)
but that did not work.
formatted text elements don't seem to show up in $form->data[''], as far as I can tell? I did a print_r on $form, and it's rather large, so perhaps I am missing something. I tried (all I need is to replace a value with something else)
$form->form_details['content'] = str_ireplace($replace, $with, $form->form_details['content']);
but that did not work.
The following did work:
However, it looks like I would also need to modify the email's text. Is there a better way to do this so that I only have to replace once?
$form->form_details->content = str_ireplace($replace, $with, $form->form_details->content);
However, it looks like I would also need to modify the email's text. Is there a better way to do this so that I only have to replace once?
Hmm, I have been able to explicitely replace the content of the email template with
I would assume that the index in form_actions[2] is dependent on the number/ordering of the events of the form.
I do this in an On Submit event handler. It works fine. Is this the best way to do this?
$form->form_actions[2]->content1 = str_ireplace($replace, $with, $form->form_actions[2]->content1);
I would assume that the index in form_actions[2] is dependent on the number/ordering of the events of the form.
I do this in an On Submit event handler. It works fine. Is this the best way to do this?
This topic is locked and no more replies can be posted.