It would be good to have the option for radio buttons to have the Default Value box
1 Like
With a choice based field, you are already setting the values. If you want to have one pre-selected when the form is rendered, just select that option in the field, in the form builder, and save the form. That option will be pre-selected when the form is shown.
Is that what you are looking for?
Hey! We actually wanted it for pre-populating buddypress profile fields. We are able to pull in buddypress fields for Single line text and dropdown fields but not Radio buttons.
// BuddyPress custom merge tag
add_filter(‘gform_replace_merge_tags’, function ($text, $form) {
$merge_tag = ‘{bpfield_Company}’; // Change this to any name you may want to use for your merge tag
if (strpos($text, $merge_tag) === false || !empty($form)) {
return $text;
}
$current_user = wp_get_current_user();
// Change BP Text to the label defined for your field in BuddyPress
$bp_field_content = bp_get_profile_field_data(array('field' => 'Company', 'user_id' => $current_user->ID));
return str_replace($merge_tag, $bp_field_content, $text);
}, 10, 2);