Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

209
Views
Angular 2 Disabled Required Control is invalid

I'm using Angular 2 Reactive Form. I have a form Control which is defined with required validation. When the user loads the form and this control is populated Angular consider the form control as valid. (Which is good!)

However, if the form control is populated and it's also disabled angular consider it as invalid? (W-H-Y?)

Have anyone encountered this? Is this a bug or by design?

Thanks!

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

This is by design, as per the W3C standard disabled inputs are not valid. In Angular you can use FormGroup.getRawValues() if you want to retrieve all values regardless of whether they are disabled or not.

Alternatively consider using the readonly attr instead.

about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!