I have two fields. It is necessary that the second field be validated on the client side depending on the choice of the first one. I need to dynamically change yii.validation.required (value, messages) for another field when choosing the first one, but is it possible at all? According to the standard, yii.validation.required (value, messages) works only for the current field (that is, the one with which the action is happening now). I would be grateful if you could tell me some other way I can dynamically change the validation of the second field depending on the first ...
@Blacknife I'd like to do something like
[['hours', 'minutes'], 'required', 'whenClient' => 'function (attribute, value) { if($('#customer-hours').val() == 0 && $('#customer-minutes').val() == 0){ //если hours == 0 и minutes == 0, то нужно как-то передать ошибку об обязательном заполнении в minutes из hours, а в hours оставить по дефолту как есть required } }', 'message' => 'Обязательно к заполнению']