almost! 🙂
I got all the objects and been able to send them through email,
the only problem left is I get the chosen radio button value, and I need the chosen radio button’s name.
This is my relevant code now:
$body = '';
$fields = get_field_objects($post_id);
if( $fields )
{
foreach( $fields as $field_name => $field )
{
$body .= '<li>';
//the field label:
$body .= '<h3>' . $field['label'] . '</h3>';
//the chosen radio button value:
$body .= $field['value'];
$body .= '</li>';
}
}
the answers in this form, are based on radio buttons i.e.
yes : YES
no : NO
hellno : Hell No
only I use numbers for the values.
for some reason, I can’t have two buttons with the same value.
i.e.
2 : YES
1 : No
1 : Hell No
The reason I need it is to sum all the values in order to see if the user is qualified. in some questions, I have two answers that have the same score (I don’t care for example if he says “no” or “hell no”, but I do need to give him the chance to say it.
hope I made it clearer 🙂
I dodn’t even think it could be that simple.
thanks!
made a new group of radio button fields and submitted with
<?php
$options = array(
'post_id' => 'user_'.$current_user->ID,
'field_groups' => array(232),
'form' => true,
'return' => add_query_arg( 'updated', 'true', get_permalink() ),
'html_before_fields' => '',
'html_after_fields' => '',
'submit_value' => 'Update'
);
acf_form( $options );
?>
now my only problem is that I need to make some of the radio buttons to have the same value inside the same group.
is it possible?
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.