Capture values of the selected checkbox custom field

Hi guys,

It’s nothing urgent or problems with the plugin. But if you can help me, at least point the way to solve my problem.

I’m trying to create a custom field with checkbox inputs.

So I created the function to render the field http://pastebin.com/cjHwWraX

/**
 * Custom field to select class days
 */
function nf_jr_field_class_days( $name, $value, $field ) {
    $inputs = '<input type="checkbox" id="mon" value="Mon"> <label for="mon">Monday</label><br>';
    $inputs .= '<input type="checkbox" id="tue" value="Tue"> <label for="tue">Tuesday</label><br>';
    $inputs .= '<input type="checkbox" id="wed" value="Wed"> <label for="wed">Wednesday</label><br>';
    $inputs .= '<input type="checkbox" id="thu" value="Thu"> <label for="thu">Thursday</label><br>';
    $inputs .= '<input type="checkbox" id="fri" value="Fri"> <label for="fri">Friday</label><br>';
    $inputs .= '<input type="checkbox" id="sat" value="Sat"> <label for="sat">Saturday</label><br>';
    $inputs .= '<input type="checkbox" id="sun" value="Sun"> <label for="sun">Sunday</label>';
 
    echo $inputs;
}
add_action( 'fl_builder_control_nf-class-days', 'nf_jr_field_class_days', 1, 3 );

and define in module settings:

'days' => array(
   'type'          => 'nf-class-days',
   'label'         => __('Class Days', 'fl-builder')
)

So far everything is fine.

My question is how to capture the values of the selected fields, because they do not appear in $settings object.

stdClass Object
(
    [session] => Fall 2015
    [program] => Soccer
    [location] => Astoria
    [days] => 
    [gender] => 
    [room] => 
    [instructor] => 
    [cat2] => 
    [cat3] => 
    [margin_top] => 
    [margin_bottom] => 
    [margin_left] => 
    [margin_right] => 
    [responsive_display] => 
    [animation] => 
    [animation_delay] => 0.0
    [id] => 
    [class] => 
    [type] => nf-jackrabbit-class-listing-module
)

Any thoughts about how to handle this will be appreciated!

Thanks!

I did not understand what this $value parameter being passed to the function.

Please how do I delete this post?? LOL!

It was a dumb question.

Now that I’ve seen that we can create Multi Select Field!

Sorry and Thanks!

No worries at all, Marlon, there are no dumb questions! We’ll mark it as resolved for now, but feel free to let us know if you need anything further!

Best,
Billy