Home › Forums › Front-end Issues › Taxonomy IDs in forms
Hi
I’m having some trouble with the CSS ID on taxonomies for select boxes.
I have a form with a number of select boxes, most of which are relationships but with one as a taxonomy.
The relationship select boxes all receive a CSS ID in the form of
<select id="acf-field-climbing_centre" class="post_object" name="fields[field_5298b914ea407]">
however, taxonomy fields look like this:
<select name="fields[field_52e7f08dec08a]">
…they’re missing the ID that’s assigned to other fields.
Anyone have any idea why this might be the case? I need these IDs as I’m using them to pre-populate fields using JS.

Hi @shankie,
Looks like the taxonomy select field does not echo an ID, I have raised an issue with Elliot.
In the mean time, can you update your jQuery selector to target the name? Eg:
$('select[name~="field_52e7f08dec08a"]);
I am using the contains word selector here => http://api.jquery.com/attribute-contains-word-selector/
Hi @acf-support,
Thanks for the tips. That’s grand, I’ll try using the name tomorrow. It should solve the problem.
In a way, glad to know that it wasn’t just me being careless.
Thanks for your help.
andrew

Hi @shankie
Thanks for the report. I’ll add this to the to-do and fix the missing attributes.
Thanks
E

Hi @shankie
Thanks for the request. This has been pushed to github and will be released soon.
Cheers
E
The topic ‘Taxonomy IDs in forms’ is closed to new replies.
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.