Drupal 7 Ajax Forms - select element
The problem is that Drupal is unable to find the element #abcd in the further calls.

Since you are returning the values alone, it will replace the element #abcd with the value; so the element #abcd will be removed from the document, and it will not be available for further processing. That's why it is not updating the values in the second time.

To overcome this in form_example_dynamic_myajax(), you need to return the values like in the following code.

 function form_example_dynamic_myajax($form, $form_state) {
   return '&lt;div id="abcd"&gt;' . $form_state['values']['tables'] . '&lt;/div&gt;';
 }