Home › Forums › General Issues › True/False required field is asking to be checked › Reply To: True/False required field is asking to be checked
Actually, no, false is not a value. A true false field is actually a checkbox field and a checkbox field only has a value if it is checked. This is because a checkbox field creates an array of checked items and with nothing checked the array is empty.
Setting required on this field only makes sense if you want to refuse submission if it is not checked for something like “I agree with….”
There are only two possible values, true and false, if you will except either then there is no reason to make it required.
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!
🚀 This week’s session of ACF Chat Fridays dips into the preliminary results of our first ever user survey. Don’t miss it! https://t.co/3UtvQbDwNm pic.twitter.com/kMwhaJTkZc— Advanced Custom Fields (@wp_acf) May 9, 2023
© 2023 Advanced Custom Fields.