Change ID of webform hidden element How can I change the ID of a hidden element (created with the Drupal 6 webform module) using hook_form_alter()?

The ID that it outputs is something like '#edit-submitted-component-name'. I need the ID to be something very custom and I need to avoid changing it with Javascript. The form API does not support the #atrributes token on hidden elements, so I can't set the ID via hook_form_alter();

Any suggestions would be really helpful. Thank You.
I had a similar issue to deal with. I need to generate form IDs programmatically so I implemented below code.

function voci_comment_form($form, &amp;$form_state, $cid) {
     $form['#attributes']['id'] = 'voci-comment-form-' . $cid;
     $form['#attributes']['class'][] = 'voci-comment-form';
     $form['body'] = array(
      '#title' =&gt; 'Post a comment',
      '#type' =&gt; 'textarea',
      '#resizable' =&gt; FALSE,
      '#rows' =&gt; 1,
     );
     $form['comment'] = array(
      '#type' =&gt; 'submit',
      '#value' =&gt; 'Comment',
     );

      return $form;
   }


It's true that you can set $element['#attributes']['id'] and that will apply to the form field. 

I hope this helps... :)