mirror of
https://github.com/silverstripe/silverstripe-userforms.git
synced 2024-10-22 17:05:42 +02:00
Change error messages for UserFormsNumericField
This commit is contained in:
parent
f213eecaf9
commit
7bf85efba9
@ -55,16 +55,10 @@ class UserFormsNumericField extends NumericField
|
||||
}
|
||||
|
||||
if ((!empty($this->min) && $this->value < $this->min) || (!empty($this->max) && $this->value > $this->max)) {
|
||||
$validator->validationError(
|
||||
$this->name,
|
||||
_t(
|
||||
'UserFormsNumericField.ErrorMsg',
|
||||
"This must be between {min} and {max}",
|
||||
['min' => $this->min, 'max' => $this->max]
|
||||
),
|
||||
"validation",
|
||||
false
|
||||
);
|
||||
$msg = (!empty($this->min) && $this->value < $this->min) ?
|
||||
_t(self::class . 'RANGE_ERROR_MIN', 'Please enter a value that is no less than {min}.', $this->min) :
|
||||
_t(self::class . 'RANGE_ERROR_MAX', 'Please enter a value that is no more than {max}.', $this->max);
|
||||
$validator->validationError($this->name, $msg, "validation", false);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user