Heine

  • Home
  • Drupal
  • About
Home » Guides » Drupal Developer FAQ

FAPI - How to decrease/increase the text limit of textfields?

Set the #maxlength property.

// Only allow 5 characters.
$form['example'] = array(
  '#type' => 'textfield',
  '#maxlength' => 5,
  // ...
);

The default value is 128.

‹ Drupal Developer FAQ up Help! - Cannot access a global variable. ›
  • Printer-friendly version

Recent posts

  • Teampassword manager's password generator is biased
  • Other vectors for SA-CORE-2014-005?
  • Lazy loading: hook_hook_info is for hook owners only.
  • "Always offline" problem in EA's Origin due to antivirus
  • From bug to exploit - Bakery SSO
more

Security reviews

I provide security reviews of custom code, contributed modules, themes and entire sites via LimoenGroen.

Contact us for a quote.

Follow @ustima

Copyright © 2021 by Heine Deelstra. All rights reserved.

  • Home
  • Drupal
  • About