Home Forums General Issues User field JavaScript update


User field JavaScript update

  • I am quite new to the ACF JS API and I am trying to add a new user to a standard, User Array, multiple-value user field through this function,

    function adduser(user) {
    var users = acf.getField(‘field_6245d676d84e8’);
    var userlist = users.val();
    // This correctly gets an user array with the current users from my user field

    newlist = userlist.push(user);
    newlist = userlist.push(‘6’);
    // Both successfully these add an user to the userlist array,

    // But this fails to update the user field,

    How should this be done?

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.