Hi,
Problem/Motivation
Minimum length can be set in the component Form display tab but it is not added to the form item attributes (while maxlength is).
Steps to reproduce
Set minimum length to a text/textarea/email... component, check the HTML source code: no minlength attribute.
Proposed resolution
Same issue exists for Webform 8.x-5.x-dev (https://www.drupal.org/project/webform/issues/2843424) and the proposed patch might help as a starting point.
Thanks
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | beforePatch.png | 14 KB | paulocs |
| #7 | afterPatch.jpg | 29.17 KB | paulocs |
| #5 | 3216513-4.patch | 7.42 KB | jrockowitz |
| #2 | 3216513-2.patch | 1.76 KB | jrockowitz |
Comments
Comment #2
jrockowitz commentedThis issue should also be addressed in 8.x-5.x
Comment #3
jrockowitz commentedComment #5
jrockowitz commentedComment #6
jrockowitz commentedComment #7
paulocsTests look good and patch is working as expected.
Before patch no minlength attribute was set.
Moving to RTBC.
Comment #8
philyHi,
Patch #5 seems OK using Webform 6.0.3 and Drupal 8.9.16, thanks to jrockowitz for that quick fix.
Comment #9
jrockowitz commentedPlease consider joining the Webform module's Open Collective to help ensure that the Webform module is maintained.