<?php
$form = $this->beginWidget('CActiveForm', array(
    'id' => 'comment-form',
    'enableAjaxValidation' => false,
    'enableClientValidation' => false,
        ));
?>
<div class="tab-content">
    <div class="tab-pane active">

        <ul class="clearfix form-ul material">

            <?php echo $form->hiddenField($model, 'id'); ?>

            <li class="col-sm-12">
                <?php echo $form->textArea($model, 'comments', array('data-label' => 'Comments')); ?>
            </li> 
		
        </ul>
    </div>

</div>
<div class="modal-footer">
    <button type="button" class="btn btn-default" id="comment_close" data-dismiss="modal">Close</button>
    <?php
    $url = Yii::app()->createUrl('MasComments/Save');
    echo CHtml::ajaxSubmitButton('Save', $url, array(
        'dataType' => 'json',
        'type' => 'post',
        'success' => 'function(data) {
                                $("#loader").hide();
                                    if(data.status=="success"){  
                                        t8.success("Area Saved Successfully!");
                                        $("#comment_close").click();
                                        reloadTable("#tbl_comment_details");
                                    } else { 
                                        $("#comment-form .comment-save-btn").prop("disabled", false);                      
                                        $("#comment-form .comment-save-btn").addClass("btn-theme").removeClass("btn_loading"); 
                                        $.each(data, function(key, val) {
                                            t8.error(""+val+""); 
                                        }); 
                                    } 
                            }',
        'beforeSend' => 'function(){ 
                               $("#loader").show();
                               $(".toast8-error").hide();
                               $("#comment-form .comment-save-btn").prop("disabled", true);                      
                               $("#comment-form .comment-save-btn").addClass("btn_loading").removeClass("btn-theme"); 
                                
                            }'
            ), array('id' => 'mybtn' . rand(), 'class' => 'comment-save-btn btn btn-theme'));
    ?>
</div>
<?php $this->endWidget(); ?>
