For standard drop downs use:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | /* add multiple fields to Formidible standard dropdowns */ add_filter('frm_setup_new_fields_vars', 'customize_dfe', 25, 2); function customize_dfe($values, $field){ if($field->id == 125){//Replace 125 with the ID of your data from entries field global $frm_field; $values['form_select'] = 3441; $field4_opts = FrmProFieldsHelper::get_linked_options($values, $field); $values['form_select'] = 3428; $field3_opts = FrmProFieldsHelper::get_linked_options($values, $field); $values['form_select'] = 3430; $field2_opts = FrmProFieldsHelper::get_linked_options($values, $field); foreach($values['options'] as $id => $v){ $sep2 = ($field2_opts[$id] !== null && $field2_opts[$id] !== "") ? ", " : ""; $sep3 = ($field3_opts[$id] !== null && $field3_opts[$id] !== "") ? " | SSN: " : ""; $sep4 = ($field4_opts[$id] !== null && $field4_opts[$id] !== "") ? " | State ID: " : ""; $values['options'][$id] .= $sep2 . $field2_opts[$id] . $sep3 . $field3_opts[$id] . $sep4 . $field4_opts[$id]; } } return $values; } |
For dynamic fields (Formidable Pro only), use:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | * add multiple fields to Formidible dynamic dropdowns */ add_filter('frm_setup_new_fields_vars', 'customize_dfe', 25, 2); function customize_dfe($values, $field){ if($field->id == 125){//Replace 125 with the ID of your data from entries field global $frm_field; $values['form_select'] = 3441; $field4_opts = FrmProDynamicFieldsController::get_independent_options($values, $field); $values['form_select'] = 3428; $field3_opts = FrmProDynamicFieldsController::get_independent_options($values, $field); $values['form_select'] = 3430; $field2_opts = FrmProDynamicFieldsController::get_independent_options($values, $field); foreach($values['options'] as $id => $v){ $sep2 = ($field2_opts[$id] !== null && $field2_opts[$id] !== "") ? ", " : ""; $sep3 = ($field3_opts[$id] !== null && $field3_opts[$id] !== "") ? " | SSN: " : ""; $sep4 = ($field4_opts[$id] !== null && $field4_opts[$id] !== "") ? " | State ID: " : ""; $values['options'][$id] .= $sep2 . $field2_opts[$id] . $sep3 . $field3_opts[$id] . $sep4 . $field4_opts[$id]; } } return $values; } |