当我进行验证时 - 我有两个字段:age_from和age_to。 但他们只有一个错误字段(help-block)“age_to”。 在模型中有规则:
['age_from', 'dateFunc'],
['age_to', 'dateFunc'],
public function dateFunc(){
if($this->age_from < 1){
$this->addError('age_to', 'error message1');
}
if($this->age_to < 1){
$this->addError('age_to', 'error message2');
}
问题 - 当第一个字段出错时,它不是红色边框。 是否有可能为未经验证的字段创建红色边框,但是要在另一个div中显示该消息?