Home › Forums › General Issues › Accessing field values with HTML DOM and jQuery › Reply To: Accessing field values with HTML DOM and jQuery
The fields do not use the field name in the ID. For single fields, like a text field you would use $('#acf-field_1234567890abc')
where the part after #acf-
is the field key. This will work for any field that has a single input like a text, or number field. For others you may need to use something like $('[data-key="field_1234567890abc"] input')
for fields like radio and checkbox fields.
The key here is that the fields use the field key and not the field name. Use and inspector like Firebug in Firefox to inspect what you’re trying to get.
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.