I don’t know that any of that code will work specifically for an ACF field. I provided the link for information of possible ways that you can achieve what you want.
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.