Active
Project:
Helper
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
30 Mar 2020 at 16:36 UTC
Updated:
30 Mar 2020 at 16:36 UTC
Jump to comment: Most recent
Using a "number" field isn't ideal for all types of numeric-based input:
I would like to add a "numeric" field type in Helper that would help support this:
$form['account_number'] = [
'#type' => 'textfield',
'#title' => $this->t('Account Number'),
'#size' => 15,
'#maxlength' => 15,
'#attributes' => [
'inputmode' => 'numeric',
'pattern' => '[0-9]*',
],
'#element_validate' => [
[Number::class, 'validateNumber'],
],
];
Comments