• Resolved malpica

    (@malpica)


    Hi,

    I need populate form (B) with data submitted by other form (A).
    I have inserted code:
    [CP_CALCULATED_FIELDS_RESULT]
    <SCRIPT>
    cpcff_default = { 1 : {} };
    cpcff_default[1][ ‘fieldname1’ ] = ‘<%fieldname1_value%>’;
    cpcff_default[1][ ‘fieldname5’ ] = ‘<%fieldname5_value%>’;
    cpcff_default[1][ ‘fieldname6’ ] = ‘<%fieldname6_value%>’;
    cpcff_default[1][ ‘fieldname7’ ] = ‘<%fieldname7_value%>’;
    cpcff_default[1][ ‘fieldname10’ ] = ‘<%fieldname10_value%>’;
    cpcff_default[1][ ‘fieldname12’ ] = ‘<%fieldname12_value%>’;
    cpcff_default[1][ ‘fieldname17’ ] = ‘<%fieldname17_value%>’;
    cpcff_default[1][ ‘fieldname19’ ] = ‘<%fieldname19_value%>’;
    </SCRIPT>
    [/CP_CALCULATED_FIELDS_RESULT]
    but not it’s populating second form

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

    (@codepeople)

    Hello @malpica,

    Which are the links to the webpages where the forms are inserte?

    Best regards.

    Thread Starter malpica

    (@malpica)

    my provisional site is https://www.test.mendivilyasociados.com/

    I’m trying to make the radio buttons fields of form B appear on the thank-you page with the value I gave them from form A

    Plugin Author codepeople

    (@codepeople)

    Hello @malpica,

    I’ve checked your website and the issue is simple, your WordPress converts the changes of lines in <br> tags, and the single quotes supported by javascript with others that are not supported, so, the piece of code would be:

    
    [CP_CALCULATED_FIELDS_RESULT]<pre style="display:none"><SCRIPT>cpcff_default = { 1 : {} }; cpcff_default[1]['fieldname1']= '<%fieldname1_value%>'; cpcff_default[1]['fieldname5']='<%fieldname5_value%>'; cpcff_default[1]['fieldname6']='<%fieldname6_value%>'; cpcff_default[1]['fieldname7']='<%fieldname7_value%>'; cpcff_default[1]['fieldname10']='<%fieldname10_value%>'; cpcff_default[1]['fieldname12']='<%fieldname12_value%>'; cpcff_default[1]['fieldname17']='<%fieldname17_value%>'; cpcff_default[1]['fieldname19']='<%fieldname19_value%>';</SCRIPT></pre>[/CP_CALCULATED_FIELDS_RESULT]
    

    Best regards.

    Thread Starter malpica

    (@malpica)

    It’s works fine!!!!
    One more thing. If I want populate form(C) with form (B) values in the same page??

    Plugin Author codepeople

    (@codepeople)

    Hello @malpica,

    In this case, assuming you want populate the fields: fieldname3, and fieldname4 of form B in the same page with the values of fields: fieldname1 and fieldname5 in the first form, respectively (the fields’ names are hypothetical, only to describe the process) the shortcode would be:

    
    [CP_CALCULATED_FIELDS_RESULT]<pre style="display:none"><SCRIPT>cpcff_default = { 1 : {} }; cpcff_default[1]['fieldname1']= '<%fieldname1_value%>'; cpcff_default[1]['fieldname5']='<%fieldname5_value%>'; cpcff_default[1]['fieldname6']='<%fieldname6_value%>'; cpcff_default[1]['fieldname7']='<%fieldname7_value%>'; cpcff_default[1]['fieldname10']='<%fieldname10_value%>'; cpcff_default[1]['fieldname12']='<%fieldname12_value%>'; cpcff_default[1]['fieldname17']='<%fieldname17_value%>'; cpcff_default[1]['fieldname19']='<%fieldname19_value%>'; cpcff_default[2]={}; cpcff_default[2]['fieldname3']='<%fieldname1_value%>'; cpcff_default[2]['fieldname4']='<%fieldname5_value%>';</SCRIPT></pre>[/CP_CALCULATED_FIELDS_RESULT]
    

    The new piece of code is:

    
    cpcff_default[2]={}; cpcff_default[2]['fieldname3']='<%fieldname1_value%>'; cpcff_default[2]['fieldname4']='<%fieldname5_value%>';
    

    Best regards.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Populate form with data submitted by other form’ is closed to new replies.