Drupal Form Checkbox having different name and id (of my choice) As drupal assigns title as both id and name to a form element.

$form['wrapper'][$unitClean.'_container'][$unitClean.'_cb'] = array(
                '#type' =&gt;'checkbox', 
                '#title' =&gt; t($unit),
                );


I need name and id to be different for checkboxes, textboxes and select lists. Anybody with any idea?

I want to do this because I am populating multiple form elements in a loop, need to manipulate them using JS (in form of groups) and then process them on next page.
Found answer,
done like this:

$form['wrapper'][$unitClean.'_container'][$unitClean.'_cb'] = array(
                '#type' =&gt;'checkbox', 
                '#title' =&gt; t($unit),
                '#attributes' =&gt; array(
                  'name' =&gt; $unitClean.'_name',
                  'id' =&gt; $unitClean.'_id',
                  'onclick' =&gt; 'checkall();'                 
                    )
                );