"null" option for radio button
-
I have radio buttons with options for “none”, “small”, “medium”, “large” with default set to “none”.
I use conditions to display another field if the value is “small”, “medium”, or “large”.if(get_field('my_field') …
works as long as I don’t set a value, but if I set the value to something and then go back to “none”, it doesn’t work anymore.if(get_field('my_field') != "none") ...
works if the value has been set to “none”, but does not work with the initial value.if( get_field('my_field') && (get_field('my_field') != "none") ) ...
works. But I was wondering if there is a simpler option.
- The topic ‘"null" option for radio button’ is closed to new replies.