A user asked the following question on the FormidableForms Community Forum:
I have a form in which I used the following script to copy text from one text field to another (lookup text field). It worked until now. But now that I have moved these two fields into a repeatable section, the script has stopped working.
When you added the fields to the repeatable section, the field ID changed.
The first field on form is field_o8v4sw-0. When you add a row to a repeatable section, the field ids will incremented. So, if you 9 more rows, the field ids will be:
Counting always starts at 0. Instead of checking for each individual field to change, this can be done with a wild card.
var sourceField = $(this).val(); //source field key
In order to determine the destination field, you're going to have to do some string manipulation. So the first thing we have to do is get the actual ID of the target field.
Next, we need to get the number at the end of the ID. This number will be the same as the destination field.
Now we can populate the destination field.
Here is your new jQuery: