How to handle ajax wrapper id for list of similar ajax forms? Consider a Drupal 7 page with a list of same-type entity forms: formA, formB, formC. The entity form uses ajax to replace part of itself. 

Is there an established way to manage the wrapper id's so that an ajax call for formA knows to replace the wrapper div in formA? If I don't change the wrapper id's, I would have three divs on the page with the same ID.
You can use drupal_html_id() which:


  Prepares a string for use as a valid HTML ID and guarantees uniqueness.


e.g.

function my_form($form, &amp;$form_state) {
  $id_string = 'my-element-id';
  $unique_id = drupal_html_id($id_string);

  $form['element'] = array(
    '#type' =&gt; 'select',
    '#options' =&gt; $options,
    '#ajax' =&gt; array(
      'wrapper' =&gt; $unique_id,
      // ...
    )
  );

  $form['output'] = array(
    '#prefix' =&gt; '&lt;div id="' . $unique_id . '"&gt;',
    '#suffix' =&gt; '&lt;/div&gt;',
    '#markup' =&gt; 'Some markup'
  );
}


That should guarantee that the AJAX will work no matter how many different instances of the same form you create.