Support

Account

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

Unread

Prevent post object field to display previously selected post

    • suspec

    • March 15, 2019 at 11:06 pm

    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)

You must be logged in to reply to this topic.

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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.