I’m building an invoice system using ACF. Selecting a user to send the invoice to is fine and dandy. But I’d like to autopopulate the next field with the email address of the selected user. How can I do this?
There would be three main differences between my example and what you want to do that would take some testing and playing.
1) Getting the value of the field were you select the user, assuming that you’re using a user field.
2) How you populate the email field, assuming you’ll be wanting to use an email field
3) The php function that gets and returns the email will need to look at users instead of posts.
If I have some time in the next few days I’ll try to take a look at it.
Only if you want to test the example, the JSON file is an export created by ACF and can be imported with ACF5. The example I created is for ACF5 and it won’t work in ACF4. The JS in ACF4 is different and not as easily extended.
I keep forgetting that not everyone is using ACF5
Viewing 7 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users