mirror of
https://github.com/silverstripe/silverstripe-userforms.git
synced 2024-10-22 17:05:42 +02:00
NEW: Set MinLength and MaxLength to numeric fields
BUG: replaced spaces with tabs to meet coding conventions
This commit is contained in:
parent
938d2059fa
commit
be573dcd3c
@ -27,8 +27,7 @@ class EditableNumericField extends EditableTextField {
|
|||||||
else {
|
else {
|
||||||
$taf = new NumericField($this->Name, $this->Title, null, $this->getSetting('MaxLength'));
|
$taf = new NumericField($this->Name, $this->Title, null, $this->getSetting('MaxLength'));
|
||||||
$taf->addExtraClass('number');
|
$taf->addExtraClass('number');
|
||||||
return $taf;
|
return $taf;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -23,10 +23,11 @@ class EditableTextField extends EditableFormField {
|
|||||||
|
|
||||||
$extraFields = new FieldList(
|
$extraFields = new FieldList(
|
||||||
new FieldGroup(_t('EditableTextField.TEXTLENGTH', 'Text length'),
|
new FieldGroup(_t('EditableTextField.TEXTLENGTH', 'Text length'),
|
||||||
new TextField($this->getSettingName('MinLength'), "", $min),
|
new NumericField($this->getSettingName('MinLength'), "", $min),
|
||||||
new TextField($this->getSettingName('MaxLength'), " - ", $max)
|
new NumericField($this->getSettingName('MaxLength'), " - ", $max)
|
||||||
),
|
),
|
||||||
new TextField($this->getSettingName('Rows'), _t('EditableTextField.NUMBERROWS', 'Number of rows'), $rows)
|
new NumericField($this->getSettingName('Rows'), _t('EditableTextField.NUMBERROWS',
|
||||||
|
'Number of rows'), $rows)
|
||||||
);
|
);
|
||||||
|
|
||||||
$fields->merge($extraFields);
|
$fields->merge($extraFields);
|
||||||
|
Loading…
Reference in New Issue
Block a user