From 8c9be817cce9b21afb20303ebd5cb7f43ed2f85e Mon Sep 17 00:00:00 2001 From: Luke Towers Date: Fri, 18 Jan 2019 18:14:25 -0600 Subject: [PATCH] Added support for min, max, and step for the number field type --- .../backend/widgets/form/partials/_field_number.htm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/modules/backend/widgets/form/partials/_field_number.htm b/modules/backend/widgets/form/partials/_field_number.htm index 83744abb5..5790e9b96 100644 --- a/modules/backend/widgets/form/partials/_field_number.htm +++ b/modules/backend/widgets/form/partials/_field_number.htm @@ -2,15 +2,23 @@ previewMode): ?> value ? e($field->value) : ' ' ?> + config['min']) ? $field->config['min'] : false; + $max = isset($field->config['max']) ? $field->config['max'] : false; + $step = isset($field->config['step']) ? $field->config['step'] : 'any'; + ?> + + hasAttribute('pattern') ? '' : 'pattern="-?\d+(\.\d+)?"' ?> hasAttribute('maxlength') ? '' : 'maxlength="255"' ?> getAttributes() ?>