Note: I had this problem with 'select' and 'textfield' form '#type' elements so I'm not sure if it applies to all.
In creating a ajax-enabled form element I have something like the following:
<?php
$element = array(
'#type' => 'textfield',
'#default_value' => '',
'#attributes' => array('id' => 'textfield_css_id'),
'#ajax' => array(
'wrapper' => 'ajax_update_css_id',
'callback' => 'MYMODULE_some_ajax_callback
),
);
The rest of my functions/callbacks are already in and working.
The ajax functionality works when the "#attribute => array('id' => 'SOMENAME')' is commented out.
The ajax functionality fails to work when the line remains.
I'm not sure if there is another thread on this but I wanted to point it.