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

Comments

PhilY created an issue. See original summary.

jrockowitz’s picture

Version: 6.0.3 » 8.x-5.x-dev
StatusFileSize
new1.76 KB

This issue should also be addressed in 8.x-5.x

jrockowitz’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, 2: 3216513-2.patch, failed testing. View results

jrockowitz’s picture

StatusFileSize
new7.42 KB
jrockowitz’s picture

Status: Needs work » Needs review
paulocs’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new29.17 KB
new14 KB

Tests look good and patch is working as expected.
Before patch no minlength attribute was set.

Moving to RTBC.

phily’s picture

Hi,
Patch #5 seems OK using Webform 6.0.3 and Drupal 8.9.16, thanks to jrockowitz for that quick fix.

jrockowitz’s picture

Status: Reviewed & tested by the community » Fixed
Webform logo This ticket was completed using Open Collective funds.
Please consider joining the Webform module's Open Collective to help ensure that the Webform module is maintained.

  • jrockowitz authored 4d43725 on 8.x-5.x
    Issue #3216513 by jrockowitz, paulocs: Support #minlength in components
    
  • jrockowitz authored 4d43725 on 8.x-5.x
    Issue #3216513 by jrockowitz, paulocs: Support #minlength in components
    

  • jrockowitz authored 4d43725 on 6.x
    Issue #3216513 by jrockowitz, paulocs: Support #minlength in components
    
  • jrockowitz authored 4d43725 on 6.x
    Issue #3216513 by jrockowitz, paulocs: Support #minlength in components
    

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.