I want to manipulate some variables using PHP to show them in a particular way in a thanks message but when I try to use $form->data['input'] the code gets truncated. For instance, if I add...
My thank you message displays:
Is the $form->data[] array lost after it is saved to the db?
David
<?php echo $form->data['input']; ?>
My thank you message displays:
data['input']; ?>
Is the $form->data[] array lost after it is saved to the db?
David
Just to add something, it looks to me more like the '>' in '$form->data' is being interpreted as closing the php end tag. Weird...
David
David
Hi David,
I agree - What is the entire code you have there?
It may be easier to do the manipulation in a Custom Code action
Bob
I agree - What is the entire code you have there?
It may be easier to do the manipulation in a Custom Code action
<?php
$form->data['new_var'] = a + b;
?>
and then just use the results in the template using {new_var}Bob
Thanks, Bob. You advice was useful, as usual. I placed the code as a custom code and php is not a problem anymore.
However, I'm still running into a problem: how can I retrieve the cf_id of the record that was just saved? I realized cf_id and cf_uid are not part of the $form->data array, so how can I get any of them back? I just want to say something like "your record number is XXXX" in the thanks message.
David
P.S. I got the AJAX code and tutorial. Thank you. I'll let you know as soon as I get to test it.
However, I'm still running into a problem: how can I retrieve the cf_id of the record that was just saved? I realized cf_id and cf_uid are not part of the $form->data array, so how can I get any of them back? I just want to say something like "your record number is XXXX" in the thanks message.
David
P.S. I got the AJAX code and tutorial. Thank you. I'll let you know as soon as I get to test it.
Hi David,
ChronoForms saves the 'saved data' in the $form->data array as $form->data['model_id']; if you haven't specifed a model id then the default value is $form->data['chronoform_data']
Bob
ChronoForms saves the 'saved data' in the $form->data array as $form->data['model_id']; if you haven't specifed a model id then the default value is $form->data['chronoform_data']
Bob
This topic is locked and no more replies can be posted.