• Resolved iskinderun

    (@iskinderun)


    Hello. I’m trying to place two forms on the same page for a better page layout. For this, some values in FORM 1 needs be transferred to FORM 2. I have referred your answer below.
    https://ww.wp.xz.cn/support/topic/how-to-import-value-from-another-form/

    It works perfectly just to ‘show’ imported values, but I couldn’t use them for further calculations. It seems all the fields filled with imported values are still considered as 0 in form 2. (actually, as its predefined value)

    Would there be a way to solve this? Thanks.

    • This topic was modified 7 years, 3 months ago by iskinderun.
Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @iskinderun

    If both forms are in the same page, I recommend you the following workaround:

    – In the first form, assign an unique class name to every field in the first form you want to use in the form 2, for example: field-a, field-b

    – In the second form insert a hidden field for every field you want to import from the first form, and assign to them an unique class name, for example: the fields: fieldname123 and fieldname456 with the class names: form-2-field-a, form-2-field-b respectively.

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

    – Now insert in the second form a “HTML Content” field with the following piece of code as its content:

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

    – Finally, you can use in the equations associated to the calculated fields in the second form, the hidden fields by their names as usual (in this example, the fieldname123 and the fieldname456)

    Best regards.

    Thread Starter iskinderun

    (@iskinderun)

    Thank you for quick reply.
    Yes, I tried that way referring your previous answer, and it doesn’t work.

    I’m trying to export values of calculated fields. However, the solution only works when exported fields(form 1) are number, currency, etc..
    For calculated fields, though it seems that the value is imported, it’s still considered as 0 when I try to use the value.

    Can you suggest any other way for calculated fields? Thanks.

    Plugin Author codepeople

    (@codepeople)

    Hello @iskinderun

    Please, indicate the URL to the webpage where were inserted forms with the recommended solution.

    Best regards.

    Thread Starter iskinderun

    (@iskinderun)

    http://pryderi.iwinv.net/wp/elementor-11453/

    This page shows the problem clearly.
    as you see, it works well for a number field, not for a calculated field.

    • This reply was modified 7 years, 3 months ago by iskinderun.
    • This reply was modified 7 years, 3 months ago by iskinderun.
    Thread Starter iskinderun

    (@iskinderun)

    I tried a way to transfer a calculated field to a number field ‘within the form 1’, and then export the number to form 2 again.(using your script twice) even if it’s a bit messy, thought this might solve the problem because it becomes exporting a number field. but… it didn’t. It seems it only works when the exported field’s value is handwritten.

    • This reply was modified 7 years, 3 months ago by iskinderun.
    • This reply was modified 7 years, 3 months ago by iskinderun.
    Plugin Author codepeople

    (@codepeople)

    Hello @iskinderun

    I’ve checked your form and you have not followed my instructions.

    In the second form you SHOULD INSERT A HIDDEN FIELD (not a calculated field) and assign to it your current class name: importedfielda

    Note: remove the class name importedfielda from the calculated field.

    and then, in the equation associated to the calculated field you use this hidden field by its name: fieldname#### (the field name that corresponds)

    Best regards.

    Thread Starter iskinderun

    (@iskinderun)

    Oh god. It was a unique field name.thought you meant any field hidden from public. Thank you so much and sorry for not understanding a brilliant instruction.

    Plugin Author codepeople

    (@codepeople)

    Hello @iskinderun

    It has been a pleasure to help you.

    Best regards.

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Importing value from another form’ is closed to new replies.