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
Hi @elliot,
That’s great—–thanks for sorting out.
Cheers
a.