Topic: Required controls on an inactive tab block the final Save button
miloCodes87
free
asked 1 week ago
A customer profile form is split across three pills panels. Saving from the contact panel sometimes does nothing, and the console says that an invalid form control is not focusable. The empty required field belongs to another panel.
We need to submit the whole profile, including the inactive panels. Should we remove required from hidden controls, or is there a better way to show the panel containing the first error?
Igor Przybysz
staff
answered 1 week ago
Inactive panels still contain form controls, and required fields in those panels still participate in validation. Because this form submits the entire profile, removing required would hide a real validation error rather than resolve the focus problem.
Use an application validation flow that identifies the first invalid control, activates its containing panel through the documented tab behavior, and then focuses or reports that control once the panel is visible. Please share the panel markup and submit handler so we can show where that activation belongs. Disabling controls is appropriate only if you intentionally want their values excluded from submission.
https://mdbootstrap.com/docs/standard/navigation/pills/
https://mdbootstrap.com/docs/standard/forms/input-fields/
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- ForumUser: Free
- Premium support: No
- Technology: MDB Standard
- MDB Version: MDB5 9.3.0
- Device: Laptop
- Browser: Chrome
- OS: macOS
- Provided sample code: No
- Provided link: No