title: Show error message in textfield in Yii
body: <p>I have used  'enableClientValidation'=>true, in Yii active form to enable client side validation.It works fine but I want to display error message in the instead of under the field.
  I worked according to <a href="https://stackoverflow.com/questions/11883820/yii-how-to-add-css-error-class-to-input-on-form-submit.This">Yii. How to add css &quot;error&quot; class to input on form submit?</a> code adds the error_input class on textfield but error still appears under textfield. 
  Any Help Should be Appreciated.</p>
  
  <p>My code is </p>
  
  <pre><code>&lt;?php 
       $form = $this-&gt;beginWidget('CActiveForm', array(
        'id'=&gt;'contact-form',
        'enableClientValidation'=&gt;true,
        'clientOptions'=&gt;array(
            'validateOnSubmit'=&gt;true,
            'afterValidate' =&gt; 'js:function(form, data, hasError) { 
                if(hasError) {
                    for(var i in data) $("#"+i).addClass("error_input");
                    return false;
                }
                else {
                    form.children().removeClass("error_input");
                    return true;
                }
            }',
            'afterValidateAttribute' =&gt; 'js:function(form, attribute, data, hasError) {
                if(hasError) 
                   $("#"+attribute.id).addClass("error_input");
                else 
                   $("#"+attribute.id).removeClass("error_input"); 
            }'
              ),
  
      )); ?&gt;
  
  
      &lt;div class="margin-bottom3 label-width1"&gt; &lt;?php echo $form-&gt;labelEx($Customer,'restaurant_name',array('class'=&gt;'label-texts')); ?&gt;&lt;/div&gt;
      &lt;div class="name-common-div"&gt; &lt;?php echo $form-&gt;textField($Customer,'restaurant_name',array('class'=&gt;'text-background customer_fields')) ?&gt;
      &lt;?php 
            echo $this-&gt;msg; 
            echo $form-&gt;error($Customer,'restaurant_name',array('class'=&gt;'check-add-member-error')); 
      ?&gt;
   &lt;/div&gt;
  </code></pre>
  
  <p>How can i do this?`</p>