 <?php $form = $this->beginWidget('CActiveForm', array(
    'id' => 'notes-form-2',
    'enableAjaxValidation' => false,
    'enableClientValidation' => false,

    ));
 ?>
<ul class="clearfix form-ul material">
  
     <li class="col-sm-6">
         <input type="hidden" name="hid_cust_id" id="hid_vendor_id" value="<?php echo $var; ?>">
         <?php echo $form->hiddenField($modelnote,'customer_vendor_id',array('value' => $var));?>
           <?php echo $form->textArea($modelnote, 'notes', array('title' => 'Please enter notes','data-label'=>'Notes ')); ?> 
        <?php echo $form->error($modelnote, 'notes'); ?>
    </li>
    
</ul>
<?php //if($models->id > 0){ ?>
<div class="modal-footer">
        
        <button type="button" class="btn btn-danger" onclick="loadPopupModal('vendor/createvendoredit&id=<?php echo $var ?>','Edit Vendor','lg')">Close</button>
<?php
                $url = Yii::app()->createUrl('vendor/saveNote');
                echo CHtml::ajaxSubmitButton('Save', $url, array(
                            'dataType' => 'json',
                            'type' => 'post',
                            'success' => 'function(data) {
                               
                                var cust = $("#hid_vendor_id").val();
                                    if(data.status=="success"){  
                                         t8.success("Notes Saved Successfully!");
                                         loadPopupModal("vendor/create&id="+cust,"Edit Vendor","lg");
                                    } else { 
                                         $.each(data, function(key, val) {
                                                $("#notes-form-2#"+key+"_em_").text(val).show(); 
                                                t8.error(""+val+""); 
                                            }); 
                                    } 
                                    }',
                            'beforeSend' => 'function(){
                                $("#notes-form-2.notes-save-btn").prop("disabled", true);
                                
                                $("#notes-form-2.notes-save-btn").addClass("btn_loding").removeClass("btn btn-primary"); $(".errorMessage").hide(); }'
                                
                    ), array('id' => 'mybtn' . rand(), 'class' => 'notes-save-btn btn btn-theme'));
           
    ?>
</div>
<?php // } ?>
     <?php $this->endWidget(); ?>    