Home › Forums › Backend Issues (wp-admin) › Updating field values using the Javascript API › Reply To: Updating field values using the Javascript API
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?
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.