• Hi.. i’m trying to write a widget and I need to have multiple checkboxes so that the user can select different options. As the number of the options is dynamic, I can’t name each checkbox differently so what I have is:

    <input type="checkbox" name="widget_options[]" value="'.$widget_options['id'].'" />

    I’m using:

    $defaults = array('widget_options' => "");

    to handle these fields, but in the “update” section of my widget where I have:

    foreach($new_instance['widget_options'] as $current_option)
    {
    	if ($current_option == $widget_options['id'])
    	{
    	    //activates a flag for successfully passing
    	}
    }

    nothing seems to happen. What is the correct syntax of passing such parameters with the widget manager? Can anyone help me figure out the problem?

    Thanks beforehand

The topic ‘Widget development problem with checkboxes’ is closed to new replies.