In preparation for converting CF7 forms with repeats to CF8 I am playing with a simple CF8 form to get to grips with the CF8 implementation, and have a question about complex listeners within the repeat group.
I have a repeater area with key name "n" and all the fields within the repeat area have field names "myfieldname[n]". I have an event trigger on field "class[n]" called "ClassChanged" and I have an advanced listener on field "craft_label[n]" to call a javascript function CopyCraftName when ClassChanged is triggered. In the javascript function I console log the arg1 that is passed to the JS function.
Simple JS function below:
function CopyCraftName(arg1){
console.log("CopyCraftName called with arg1");
console.log(arg1);
return 0;
}
When I change the field value in field class[n] on one of the clones of the repeat group the console shows the below for arg1
<input type="text" id="craft_label_n" placeholder="" value="" name2="craft_label[n]" oname="craft_label[n]">
My question is how do you get instance number of the cloned repeats that has actually changed?
environment is
CF ver 8.0.44
Joomla ver 5.2.6