I have a form with a textInput. I want the value of this textInput to be a multiple of 4 ( 4, 8, 12…). I Know it is possible to create a function that can be used in my rules. But the problem is that i need a clientSide validation.
So, i decidate to create a new validator. For this purpose i created a new file named multipleValidator under yiiSoft/yii2/validators and also added property to pub under yiiSoft/yii2/assets/yii2.validation.js. I added my validator.to the builtInvalidators array. But nothing is validated for that field. when i enter 17 for exemple, it accpets.