I have menu callback which is getting called multiple times on the same page by an AJAX request resulting rendering the form with same HTML id
$items['mymodule/page'] = array(
'page callback' => 'drupal_get_form',
'page arguments' => array('page_callback_form'),
'access callback' => TRUE,
'type' => MENU_CALLBACK,
);
function page_callback_form($form, &$form_state, $thing) {
$form['message'] = array(
'#type' => 'textarea',
'#title' => t('Message'),
'#cols' => 80,
'#rows' => 5,
);
return $form;
}
Result:
<textarea id="edit-message" name="message" cols="80" rows="5" class="form-textarea"></textarea>
<textarea id="edit-message" name="message" cols="80" rows="5" class="form-textarea"></textarea>
i was wondering is there a way i can have unique Ids, i have tried [hook_forms].1
function page_callback_form($form, &$form_state, $thing)
, and remove the$form = array();
line