Hi umarglobal,
Looks like you're pretty close with that snippet you shared. One of the issues is your trying to save the loop syntax as part of the string:
[php]
$field['content'] .= foreach($form['fields'] as &$field) {;
What you want to do is something like this:
[php]
$field['content'] = '<p>Please view your details and confirm your quotation by submitting the form</p>';
$field['content'] .= '<ul>';
foreach($form['fields'] as &$field) {
$field['content'] .= '<li>';
if($field['id']!=91) {
$field['content'] .= $field['label'];
}
$field['content'] .= '</li>';
}
$field['content'] .= '</ul>';
This just updates the syntax code so that you aren't assigning to the content string. It should now loop through all the fields and add the labels to the string. I also added in the functionality so that it will pull the value of the field from the submitted data ($_POST). That is what this bit does:
[php]
rgpost('input_' . $field['id'])
Bare in mind, this only works for simple fields. When you start getting into complex fields (aka, fields with more than one input) you'll need to add logic to get all of the POST values for that field.
Let me know how you progress from here. :)
Posted 12 years ago on Wednesday March 21, 2012 |
Permalink