No Code Attached Yet bug
avatar neo314
neo314
25 Feb 2024

Steps to reproduce the issue

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.

Expected result

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.

Actual result

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.

System information (as much as possible)

Apache2 on Ubuntu and on WAMP with J5.0.3 PHP 8.1 tested on Firefox developer and Chrome Browsers

Additional comments

I had to re-validate the form repeatedly as a work around.

avatar neo314 neo314 - open - 25 Feb 2024
avatar neo314 neo314 - change - 25 Feb 2024
Labels Removed: ?
avatar joomla-cms-bot joomla-cms-bot - change - 25 Feb 2024
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 25 Feb 2024
avatar neo314 neo314 - change - 25 Feb 2024
The description was changed
avatar neo314 neo314 - edited - 25 Feb 2024
avatar neo314 neo314 - change - 25 Feb 2024
The description was changed
avatar neo314 neo314 - edited - 25 Feb 2024
avatar neo314 neo314 - change - 25 Feb 2024
The description was changed
avatar neo314 neo314 - edited - 25 Feb 2024
avatar neo314 neo314 - change - 25 Feb 2024
The description was changed
avatar neo314 neo314 - edited - 25 Feb 2024
avatar richard67
richard67 - comment - 25 Feb 2024

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.

avatar neo314
neo314 - comment - 26 Feb 2024

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.

avatar Hackwar Hackwar - change - 27 Mar 2024
Labels Added: bug
avatar Hackwar Hackwar - labeled - 27 Mar 2024

Add a Comment

Login with GitHub to post a comment