diff --git a/src/dktapps/pmforms/element/Slider.php b/src/dktapps/pmforms/element/Slider.php index 8914c16..9fb5005 100644 --- a/src/dktapps/pmforms/element/Slider.php +++ b/src/dktapps/pmforms/element/Slider.php @@ -74,6 +74,9 @@ public function validateValue($value) : void{ if($value < $this->min or $value > $this->max){ throw new FormValidationException("Value $value is out of bounds (min $this->min, max $this->max)"); } + if($value !== 0 and fmod((float)$value, $this->step) !== (float)0){//do not use % operator + throw new FormValidationException("Value $value is not divisible by step ($this->step)"); + } } public function getMin() : float{