Take the 2-minute tour ×

Does EXT JS provide a mechanism for dependent fields? E.g. password field should not be active until the login has been entered.

share|improve this question
I don't think there's any such built-in mechanism, but you could easily hook into your login field's blur or change event to wire it up yourself. –  Jonas May 6 '11 at 0:43

2 Answers 2

up vote 4 down vote accepted

No, there is no buildin way to do this. But you can help yourself while using customValidator or any other event that fit your trigger-needs.

Modify the custom Validator on your username field to activates the disabled password field after the minimum username characters are reached.

Benefit of the customValidator is that it get's triggered while you type.

share|improve this answer

I know there was a formBind config option in Ext 3.3 and it says there is someting in 4.0 but the docs aren't very good now. It works well with buttons but I've never used them on fields before.

per ExtJS API :

Any component within the FormPanel can be configured with formBind: true. This will cause that component to be automatically disabled when the form is invalid, and enabled when it is valid. This is most commonly used for Button components to prevent submitting the form in an invalid state, but can be used on any component type.

share|improve this answer
that's suitable for field dependings... –  sra May 6 '11 at 14:38
@sra Hooking in to customValidators on fields is tedious. Idk what the indented use of the OP but the formBind option should work for them. –  pllee May 6 '11 at 17:27
But without a password the form is still invalid... As written in the API this is commonly used for buttons. The password depends on the username, not on the whole form. Formbind is intended to prevent submit of the form if anything gone wrong. –  sra May 6 '11 at 17:43
It can be used on thing other than buttons such as fields. I think it would be much easier to create a form that had a user and password field and put a formbind on the password field. The fields have to be linked somehow and the formPanel can do that for the developer. –  pllee May 6 '11 at 20:23

Your Answer


