On the front-end, I have a form with 2 subforms that add text fields for "name". The text fields cannot be blank and are hence required. All other required fields trigger validation checks on blur. The added subform elements do not appear to trigger any events, or at least have no validation bound to the events. Clicking submit, with the forms being invalid, triggers validation of the field, but then if the field does get filled in, it remains invalid until submit is clicked again. No blur event. I have not found any other events I can bind to either. I assume this is related to the field not existing when the document was fully loaded.
That adding new subform field element (in my case, add a guest to your party) would trigger a validation event if the element is clicked in and left blank on blur (like every other required text field), that the element would show invalid if it is blank when submit is clicked, AND clear that invalid status when the field is filled in.
The added subform field after form load triggers no validation event until the form is validated and when validation of the form fails and the field is marked invalid, the field triggers no validation after it is filled in to clear the invalid markings/status/class.
Note that, when the subform field is marked invalid after clicking submit and the invalid status is NOT cleared after the field is filled in, the invalid status DOES CLEAR if submit is clicked again. To demonstrate, add 2 new required fields to the subform that are left blank. Try to submit to trigger validation. Both fields are marked invalid. Fill in one. See that the field remains invalid on blur. Click submit and the invalid status of the filled in field is cleared.
Apache2 on Ubuntu and on WAMP with J5.0.3 PHP 8.1 tested on Firefox developer and Chrome Browsers
I had to re-validate the form repeatedly as a work around.
Labels |
Removed:
?
|
Labels |
Added:
No Code Attached Yet
|
I tried it. No effect. I'm confident it is not a time delay thing. You can see from my description that I make the elements inactive and then make other elements change from invalid to valid and come back to see that nothing has changed for the subform validation.
Labels |
Added:
bug
|
Could you check if PR #39838 solves this issue? The PR is for 4.4-dev and has already 2 good tests so it will be merged sooner or later and then go into 5.0-dev, too.