• Resolved dareko

    (@dareko)


    Hello,
    I have two forms on one page. I want to use the value of calculated field (fieldname99) in one form (id=25) as a value of a field (fieldname30) in the second form (is=53).
    I’ve tried to use your examples from documentation:

    [CP_CALCULATED_FIELDS id=”25″]
    [CP_CALCULATED_FIELDS_RESULT fields=”fieldname99″ formid=”25″]
    [CP_CALCULATED_FIELDS_RESULT]
    <script><br />
    cpcff_default = { 2 : {} };<br />
    cpcff_default[2][ ‘fieldname106’ ] = ‘<%fieldname99_value%>’;<br />
    </script>
    [/CP_CALCULATED_FIELDS_RESULT]
    [CP_CALCULATED_FIELDS id=”53″]

    It doesn’t work.
    I’m afraid I can not use the solution with “Thank you page” because my version of the plugin haven’t it.
    I’ve also tried to use session variable, but I do not know how to set its value to the calculated value.
    Is there any other solution for this case?
    Thank you in advance.

    The page I need help with: [log in to see the link]

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

    (@codepeople)

    Hello @dareko

    The solution you have implemented does not work in your case because you are not submitting the form, and your version of the plugin does not support the shortcode for results.

    Please, follow the steps below:

    1. Assign a unique class name to the fieldname99 in form 25, for example: field-a

    2. Insert a hidden field in form 53, and assign to it another class name, for example: field-b

    Note: the class names are assigned to the fields through their attributes: “Add CSS Layout Keywords”

    3. Insert an “HTML Content” field in the form 53 with the following piece of code as its content:

    
    <script>
    jQuery(document).on('change', '.field-a input', function(){jQuery('.field-b input').val(this.value).change();});
    </script>
    

    4. Finally, you can use the hidden field in form 53 in the equations of the calculated fields in form 53.

    Best regards.

    Thread Starter dareko

    (@dareko)

    Hello
    Thank you very much for your quick response and solution.
    It works perfectly.
    Great job.
    Kind Regards
    Dareko

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Populate values between forms’ is closed to new replies.