#states not detecting a change to form via ajax_command_invoke I have a form. On an elements I have an ajax call back.
In the callback I use the commands[] to update some elements on the screen.
One of the elements i have updated is used by another form element using the #states. When the ajax call is executed the first time the #states sees that the value has changed and updates.

When I call the ajax event for a second time the #states does not see the same.
One my ajax_commands is invoking the jQuery change().

I have an alert() being thrown when the element is changed and can see that it is being hit every time. However the #states is not updating.

Is there a way to get #states for the form to reevaluate from JavaScript?
For those who might come across this post, I think the problem is related to these issues :


Display Bug when using #states &#40;Forms API&#41; with Ajax Request
FAPI #states: dependent element added via AJAX initializes incorrectly if dependee has been initialized earlier


I found the solution to my problem (close to this one) by reading them.

Actually states may be no longer valid after an AJAX modification because some elements are still flagged as already initialized by the states system. This case produces when just the dependee element or the dependent element is altered by the AJAX request, not both. Only a side of the relation is updated, the other side keeping its old information. Dependee and dependent are therefore no longer linked and the state has no more effect.