I don’t understand why getFields (or findFields) would return an array of different objects to the singular getField object.
Seems like a mistake/oversight to be honest.
The problem is with acf.findFields({name:name}) or acf.getFields({name:name})
They are NOT returning jquery objects, whereas getField(key) IS.
I’ll report as a bug, but in the meantime I’m going to use the keys, but this is annoying as several different custom post types and forms need to use the same field names (but obviously have different keys).
So apparently we can’t use getField with the field name, so instead I try:
var f = acf.findFields({name:'custom_price'});
f.val('some val'); // doesn't work
f.each(function(i,a) {
a.val('some val'); // doesn't work, a is not a jquery object
});
f[0].val('some val'); // doesn't work, f[0] is not a jquery object
So before I post some of the more complex code I’m using, why does this simple update of a field value not work with the ACF Javascript API?