i have a problem in my own validator it does not display any error message
here is the code
view:
<div class="row">
<?php echo $form->labelEx($model,'username'); ?>
<?php echo $form->textField($model,'username',array('class'=>'signupField'),array('size'=>50,'maxlength'=>50)); ?>
<?php echo $form->error($model,'usernamecheck'); ?>
</div>
Model:
public function Validateusernamecheck(){
$checkcustomer=Customer::model()->find('LOWER(username)=?',array(strtolower($this->username)))
$checkmerchant=Merchant::model()->find('LOWER(username)=?',array(strtolower($this->username)));
if($checkcustomer || $checkmerchant)
{
echo $this->addError('username',' Username Already Exists try another user name ');
return false;
}
else
return true;
}
it just catches the error the textbox becomes red but it don’t show the message below the text box what is wrong here kindly help plzz