Home › Forums › Front-end Issues › Radio field conditional in afc_form? › Reply To: Radio field conditional in afc_form?
get_field(‘chon’) is not going to work here.
if(get_field('chon') == 'a') {
$title = $_POST['fields']['field_5558a08e10eed'];
$content = $_POST['fields']['field_555ddb4112814'];
}
else if (get_field('chon') == 'b') {
$title = $_POST['fields']['field_555efea0f3e01'];
$content = $_POST['fields']['field_555efed7f3e02'];
}
Your function is called before the field is saved, so it will have no value.
Your accessing the value for the title and content the correct way, you” need to access the value of ‘chon’ the same way.
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.