Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author codepeople

    (@codepeople)

    Hi,

    If you want to display the submitted information in the thank you page, simply should be inserted the shortcode: [CP_CALCULATED_FIELDS_RESULT] in the thank you page associated to the form.

    The shortcode: [CP_CALCULATED_FIELDS_RESULT] gives a big control over the structure of the Thank you page. Please, visit the following entry in the FAQ page of the plugin:

    https://wordpress.dwbooster.com/faq/calculated-fields-form#q230

    Best regards.

    Thread Starter kickboxerdan

    (@kickboxerdan)

    Hi, I would like to do some manual code in my results page template like:

    <?php if ($fueltype == ‘petrol’ AND $coverage == ‘local’ AND $pricing ==’pump’)
    {
    <?php the_field(‘custom_field_10’); ?>;
    }
    <?php endif; ?>

    Where $fueltype and $coverage and $pricing refer to values from the Calculated Fields Form.

    Is that possible at all?

    Many thanks,
    Dan

    Plugin Author codepeople

    (@codepeople)

    Hi,

    You should controlling the value of fields in the form, and not in the thank you page.

    For example, I’ll assume that:

    $fueltype corresponds to the fieldname1
    $coverage corresponds to the fieldname2
    $pricing corresponds to the fieldname3
    $custom_field_10 corresponds to the calculated field, fieldname4

    In the form you should associate an equation to the calculated field, fieldname4 to assign a value in function to the other fields in the form, following the example:

    (function(){
    if(fieldname1=='petrol' && fieldname2=='local' && fieldname3=='pump') return 'Value XYZ';
    return '';
    })()

    and finally, in the thank you page you simply should insert the following shortcode:

    [CP_CALCULATED_FIELDS_RESULT]<%fieldname4 if_not_empty%>[/CP_CALCULATED_FIELDS_RESULT]

    Best regards.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Use field values on results page with $_POST’ is closed to new replies.