['size', 'required','when' => function($model) {
return ($model->color == 'RED') ? true : false;
},
'whenClient' => "function() {
if($('#provider').val() == 'RED') {
return true;
} else {
return false;
}
}"]
I wonder if I still need to put the whenClient
code? My validation still working without submitting the form by using only when
.