J3 Issue ?
avatar Lab5-Switzerland
Lab5-Switzerland
7 May 2019

What needs to be fixed

In IE(11), Fields of a Subform or Repeatable Form dont validate - Seemingly.
Truth is : IE tries to validate the invisible Subform-repeatable part of the subform - which ofc never contains values by its very nature - thus always producing errors

Why this should be fixed

Because Client side form validation is essential. The bug described just exists, because repeatable fields are relatively new and this issue hasn't been addressed yet.
Also the soloution is beautifully simple and implemented in a minute.

How would you fix it

Add the suggested line ( see below ) in to the File
/media/system/js/validate-uncompressed.js , circa line 129, right after
if(jQuery(fields[i]).hasClass('novalidate')) { continue; }
ADD the following line / code :
if(jQuery(fields[i]).parents().is("template") ) { continue; }

Explanation :
If a field is directly of indirectly encapsulated into a tag, it is part of the subform's/repeatable-field's template (/reserve) part, BUT NOT the actual form in use - and thus is NOT to be treated as the part of the form in actual use. Thus, if the validator sees the a given field has as direct or indirect/farther parent a element, the validator knows that this field is not part of the form and will skipp validation on this field. Viola.
Simple and beautiful solution.
( Reation of the validator is analogue to the line before, where it makes the validator skipp the field, it it sees a "novalidate" class attached ).

Ofc, the soloution must be transferred into the compressed version ( validate.js ) too.

Side Effects expected

None.

avatar Lab5-Switzerland Lab5-Switzerland - open - 7 May 2019
avatar joomla-cms-bot joomla-cms-bot - change - 7 May 2019
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 7 May 2019
avatar Lab5-Switzerland Lab5-Switzerland - change - 7 May 2019
The description was changed
avatar Lab5-Switzerland Lab5-Switzerland - edited - 7 May 2019
avatar franz-wohlkoenig franz-wohlkoenig - change - 7 May 2019
Labels Added: J3 Issue
avatar franz-wohlkoenig franz-wohlkoenig - labeled - 7 May 2019
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 7 May 2019

Closed as having Pull Request #24832

avatar joomla-cms-bot joomla-cms-bot - close - 7 May 2019
avatar Quy Quy - change - 7 May 2019
Status New Closed
Closed_Date 0000-00-00 00:00:00 2019-05-07 15:33:39
Closed_By Quy
avatar joomla-cms-bot
joomla-cms-bot - comment - 7 May 2019

Set to "closed" on behalf of @Quy by The JTracker Application at issues.joomla.org/joomla-cms/24829

Add a Comment

Login with GitHub to post a comment