Hello @pcgrobler
The code in the link refers to forms in different pages, to use the values submitted by form A to populate a form B.
However, you are trying to populate the fields in a form with values of fields in other forms on the same page.
I’ll try to describe the process with a hypothetical example.
Assuming you have three forms on the same page: form A, B, and C, and you want to populate some fields in form A with the values of fields in the form B and C.
First, assign custom class names to the fields you want to get from forms A, and B, for example: field-a, field-b
The class names are assigned to the fields through their attributes: “Add CSS Layout Keywords”
Second, assign custom class names to the fields that will receive the values in form C, for example: field-c1 and field-c2
Finally, insert an “HTML Content” field in form C with the following piece of code:
<script>
jQuery(document).on('change', '.field-a input', function(){jQuery('.field-c1 input').val(this.value).change();});
jQuery(document).on('change', '.field-b input', function(){jQuery('.field-c2 input').val(this.value).change();});
</script>
Best regards.
Thread Starter
Pgrob
(@pcgrobler)
Hi,
Thank you for your quick reply. I had a play around with this and still couldnt get it to work.
How could I test this to see if the values show up?
I think I might be using the wrong field, what field would be best to use to show the value from the other form?
Is it definately form C I put the “HTML Content” in and not form A?
Thanks
Hello @pcgrobler
Please, send me the link to your page where the forms are inserted and indicate the fields I must populate to check your code in detail.
Best regards.