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,
// ...
);
$form['example'] = array(
'#type' => 'textfield',
'#maxlength' => 5,
// ...
);
The default value is 128.