• Resolved luciche

    (@luciche)


    Hi, can you please tell me if it’s possible to have the field value from one form to other forms?
    Example:
    The value of fieldname10 from form 8 to be in fieldname10 in form 9, 10, 12, 14
    Thank you

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

    (@codepeople)

    Hello @luciche

    Are the forms 9, 10, 12, and 14 on the same page than form 8?

    Best regards.

    Thread Starter luciche

    (@luciche)

    Yes.

    Plugin Author codepeople

    (@codepeople)

    Hello @luciche

    In the equations, you can refer to the fields by their names, only to fields in the current form.

    So, the workaround would be populated fields in the different forms with the values of the field in the main form, and then, use these fields in the corresponding equations.

    I’ll try to describe the process with only one pair of forms, and you should repeat the process with the other forms on the page.

    1. Assign a custom class name to the fieldname10 in form 8, for example: class-a

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

    2. Insert a hidden field in the form 9 (I’ll assume it is the fieldname123), and assign to it a custom class name too, for example: class-b

    3. Now, Insert into the form 9 an “HTML Content” field with the following piece of code:

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

    4. Finally, you can use the fieldname123 field in the equations associated with the calculated fields in form 9 as usual.

    Best regards.

    Thread Starter luciche

    (@luciche)

    hi,
    I’ve added class-a in the main form, from which I want the value to be copied.
    I’ve added class-b in a second form in a hidden field and I’ve added the code in an HTML field, but it doesn’t retrieve the value.

    I tried adding the CSS class with and without the . (dot)

    https://ibb.co/album/JmkJzW

    Plugin Author codepeople

    (@codepeople)

    Hello @luciche

    Please, send me the link to page where the forms are inserted.

    Best regards.

    Thread Starter luciche

    (@luciche)

    https://notariate.ro/calculator-taxe-notariale/#cff

    the main form is the 1st at the top of the page
    and the secondary form is at the bottom of the page

    Plugin Author codepeople

    (@codepeople)

    Hello @luciche

    The issue is simple, the field with the class-a class name assigned, is a hidden field, the user does not edit it directly. So, you should trigger at least an onchange event explicitly to populate the field with the class-b associated.

    Please, edit the code into the “HTML Content” field as follows:

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

    Best regards.

    Thread Starter luciche

    (@luciche)

    That worked, thank you.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Field Value from one form to another’ is closed to new replies.