Home › Forums › Backend Issues (wp-admin) › jQuery Auto Populate › Reply To: jQuery Auto Populate
Hi E,
I have one more question pls, here is my js code: http://pastebin.com/hejnDsgg
What I do here is:
1. I have 3 different post types where I want to use this auto populate
2. Every post type has different id for select menu, so I have put their id into variables to make life easier
3. I get selected value from ‘Select Country’
4. I do AJAX to get list of areas and cities for that country
5. I get response as comma seperated (eg: city1,city2,city3)
6. I do with jquery each:
$( '#' + selector_area ).append( $('<option></option>').val(text).html(text) )
This is how I append values as options under my select menu.
Now everything here works fine, but problem is that saved value is not selected or displayed.
Every time I refresh ‘Edit posts’ area is not correct so I need to select area every time I edit and save post.
Any advice please?
BR
V
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.