pre-populating field for drop down menu not working
-
add_filter( ‘ninja_forms_field’, ‘my_filter_function’);
function my_filter_function($data){
if( $data[‘label’] == “List” ){
foreach ($data[‘list’][‘options’] as $key => $value) {
if($value[‘label’] == ‘Option 2’) {
$data[‘list’][‘options’][$key][‘selected’] = 1;
}
}
}
return $data;
}The above could does not work if the List Type is a “Dropdown.” All other list type (radio, checkboxes, etc.) work.
Anybody else have this problem and can share solution if it exists?
I have a clean wordpress site with latest version and ninja forms as well as I am just testing out the functionalities.
- The topic ‘pre-populating field for drop down menu not working’ is closed to new replies.