Title: Widget development problem with checkboxes
Last modified: August 19, 2016

---

# Widget development problem with checkboxes

 *  [steeler](https://wordpress.org/support/users/steeler/)
 * (@steeler)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/widget-developemnt-problem-with-checkboxes/)
 * 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.

## Tags

 * [radiobox](https://wordpress.org/support/topic-tag/radiobox/)
 * [widgets](https://wordpress.org/support/topic-tag/widgets/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [steeler](https://wordpress.org/support/users/steeler/)
 * Last activity: [15 years, 10 months ago](https://wordpress.org/support/topic/widget-developemnt-problem-with-checkboxes/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
