Home › Forums › Front-end Issues › Get True / False field value Javascript › Reply To: Get True / False field value Javascript
Never mind, I already found the solution! just check the attribute “checked”. If the box is checked it will return the value “checked”. Otherwise the attribute will be undefined.
So by using this code I check all the boxes within a certain div:
if (jQuery(this).attr("checked")) {
// in here it means that the checkbox is checked
}
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.