Home Forums Front-end Issues Prevent post object field to display previously selected post


Prevent post object field to display previously selected post

  • Hello,

    I’m trying to understand how to prevent the post object field to autopopulate itself with the last selected value.
    Setting the ‘allow null’ to yes display the ‘x’ so that the preselected choice can be manually removed, however I’d prefer to display nothing at all (or just the normal ‘Select’ option value)! simply because I am pre-filtering the values to display in that post object field according to current_user in my functions.php file (i.e. authors can only select their own published posts) which is working fine, but in the front-end the post object is pre-filled with the last selected post and users are still able to select that option even if it’s not their post.

    I’ve got a very limited knowledge of jQuery so I’m still trying to work out how to select that element and I’m wondering if there is an alternative?
    How is ACF outputting that value and how else could I control it?

    I’ve also tried to set autocomplete to off in the act form
    'form_attributes' => array('autocomplete' => 'off')
    (tried with both ‘off’ and ‘false’ as this was also suggested somewhere in the forum) but it’s not working.

    I’m a newbie and possibly trying to bite off more than I can chew…

    Thanks to whoever can help!

Viewing 1 post (of 1 total)

The topic ‘Prevent post object field to display previously selected post’ is closed to new replies.