Home › Forums › General Issues › Select Dropdown Inside Repeater With Mailto and Tel based on Selection › Reply To: Select Dropdown Inside Repeater With Mailto and Tel based on Selection
See image and php code below but essentially:
-user goes to WP Page
-Adds Image, Title, etc
-Select Dropdown – choice of PHONE or EMAIL
If user Selects PHONE, it populates tel: before the subfield they enter of a phone number so it makes it a link
If user Selects EMAIL, it populates mailto: before the subfield they enter of a phone number so it makes it a link
Image Explanation: https://pasteboard.co/5fFEy9KEfp0o.jpg
Code Sandbox: : https://onlinephp.io/c/ea1db
in the php code – its in the div “phoneemail-selection” towards bottom where id imagine the IF / ELSE statement would go:
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.