FIX Fixes #850 added validation to numerical form fields

This commit is contained in:
Luke Amos 2019-01-16 23:32:15 +13:00
parent 2cb649abbb
commit ca06f000a1
1 changed files with 8 additions and 0 deletions

View File

@ -82,4 +82,12 @@ class EditableNumericField extends EditableFormField
$field->setAttribute('data-rule-max', $this->MaxValue);
}
}
public function validate()
{
$result = parent::validate();
if ($this->MinValue > $this->MaxValue) {
$result->addError("Minimum length should be less than the Maximum length.");
}
return $result;
}
}