title: drupal form api checkboxes
body: <p>I am using drupal form api and using checkboxes. I am getting problem in default checked values with it. following is the code snippet...</p>
  
  <pre><code>$result = db_query("SELECT nid, filepath FROM {content_type_brand}, {files} WHERE content_type_brand.field_brand_image_fid
  = files.fid");
          $items = array();
          while ($r = db_fetch_array($result)) {
                  array_push($items, $r);
          }
          $options = array();
          foreach( $items as $i ) {
              $imagePath = base_path().$i['filepath'];
              $options[$i['nid']] = '&lt;img src="'.$imagePath.'"&gt;&lt;/img&gt;';
          }
          $form['favorite_brands'] = array (
              '#type' =&gt; 'fieldset',
              '#title' =&gt; t('Favorite Brands'),
              //'#weight' =&gt; 5,
              '#collapsible' =&gt; TRUE,
              '#collapsed' =&gt; FALSE,
          );
           $form['favorite_brands']['brands_options']
  = array(
              '#type' =&gt; 'checkboxes',
              '#options' =&gt; $options,
              '#default_value' =&gt; $options_checked,// $options_checked is an array similar to $options but having elements which need to be checked by default...
              '#multicolumn' =&gt; array('width' =&gt; 3)
          );
  </code></pre>
  
  <p>but values are not checked by default... can anyone help what I am missing??</p>
  
  <p>Thanks</p>