This is an old, old problem with Drupal's form flow. If you disable a form field while building, that form field stays disabled. You can't disable it conditionally (at least not in core).

Fortunately, disabling the field isn't that vital. In fact, there's no reason you wouldn't want people to rename disabled tags. So let's not do that.

In fact, a similar problem applies to the conditional #required key, so let's just go ahead and make it unconditional. There's no reason to give a tag an empty name either.

Comments

cburschka created an issue. See original summary.

cburschka’s picture

Status: Active » Needs review
StatusFileSize
new3.14 KB

  • cburschka committed 4177861 on 8.x-3.x
    Issue #2629662: No conditional disabling.
    
    Textfields can't be disabled...
cburschka’s picture

Status: Needs review » Fixed

  • cburschka committed 4177861 on 9.x-1.x
    Issue #2629662: No conditional disabling.
    
    Textfields can't be disabled...

  • cburschka committed 4177861 on 9.x-2.x
    Issue #2629662: No conditional disabling.
    
    Textfields can't be disabled...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.