- Issue created by @drs2034
- π©πͺGermany macdev_drupal Wiesbaden
Got it working for a menu link field that way.
$form['title']['widget'][0]['value']['#maxlength'] = 25; $form['title']['widget'][0]['value']['#attributes']['data-maxlength'] = 25; $form['title']['widget'][0]['value']['#maxlength_js'] = TRUE;
Guess you just need to add that 'data-maxlength' to your example above.
For my case it needed to be inside of $element['widget'][0]['value'] to get it working.
The documentation says it different. - Status changed to Needs review
11 months ago 6:14pm 1 February 2024 - πΊπΈUnited States cedewey Denver, CO
Thanks for sharing your solution macdev_drupal.
drs2034, does that suggestion work for your situation?
If so, we would appreciate you updating the documentation β with your findings. We'll be sure to credit you on this issue if you do. Thanks!