Home › Forums › ACF PRO › How can I disable for selecting "non-public" posts from lists in relation field? › Reply To: How can I disable for selecting "non-public" posts from lists in relation field?
Hi @jonathan
Thanks again!
Yes! the way you suggested is much smarter and less code than mine!
Mine worked because of css “pointer-events : none;” applied for li.cannotselect.
But “pointer-events” works only newer browsers.
So “e.preventDefault()” is definitely better.
Actually, I tried these below at first and failed…
Then I gave up using “e.preventDefault()” for this case.
$('li.cannotselect').on('click', function(e){
e.preventDefault();
return false;
});
Also, I wanted to know if it’s possible to sort this out without using “setTimeout()”,
but you use “setTimeout()” too.
So I felt relieved in a sense 😉
Anyway, thank you a lot!
Much love from me and heaven above!
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.