Support

Account

Home Forums General Issues Target repeater sub-field with Javascript Reply To: Target repeater sub-field with Javascript

  • Ah thanks 🙂

    I ended up doing trial and error, and found this as a solution:

    
    // where field_609b103fcd576 is a sub-field in my repeater
    acf.addAction("new_field/key=field_609b103fcd576", function ($field) {
    
        $field.on("change", function (e) {
            var value = $field.val();
            console.log(value);
        });
    });
    

    Not sure if it’s the optimal one, but it worked 🤷‍♀️