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?

1 Answer 1


For those who might come across this post, I think the problem is related to these issues :

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.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.