tags:

views:

131

answers:

1

I'm building a multi-step form in Drupal 6. For some reason, the id attribute of the form element have an extra "-1" the first time the step 1 form is displayed.

For example, if the form name is "user-registration", the first time I access the step 1 form, the id is "user-registration-1". Then, if I go to step 2, the id is "user-registration". If I go back to step 1, the id remains "user-registration".

I'd like to know if there's a way for me to set the id attribute or to prevent Drupal from adding the extra "-1".

Thanks.

+1  A: 

You can set the id yourself.

$form['#attributes'] = array('id' => 'user-registration');
googletorp
Thanks, but I tested here and it added another id attribute to the form, instead of changing the value of the existing one (Drupal 6.3).
Vinicius Pinto