Hi
In yii.validation.js file is writen:
How add valaidation methods for non built-in validators provided by aurselves.
Is it possible to add such methods in a separation js file?
thanks
Hi
In yii.validation.js file is writen:
How add valaidation methods for non built-in validators provided by aurselves.
Is it possible to add such methods in a separation js file?
thanks
Sure, you can create your own validator class just the way as the builtin validators are created.
For clientValidaton you implement the clientValidateAttribute() method.
See for example Booleanvalidator on how it is done.
If your JS code is very short you can return it directly. If it needs another js file you can declare an asset bundle for it and make sure it gets registered like Yii is doing it with "ValidationAsset::register($view);"