<ul class="clearfix form-ul material">
    <div id="div_changepassword_error" style="color: red;text-align:center;"></div>
   <?php
            $form = $this->beginWidget('CActiveForm', array(
                'id' => 'changepassword-form',
                'enableAjaxValidation' => false,
                'enableClientValidation' => false,
            ));
            ?>
    <li class="col-sm-4">   

		       <input type="password" name="user_current_password" id="user_current_password" placeholder="Enter Current Password">

       <li class="col-sm-4">   
                            <input type="password" name="user_new_password" id="user_new_password" placeholder="Enter New Password">
                </li>
      <li class="col-sm-4">   
                            <input type="password" name="user_reenter_password" id="user_reenter_password" placeholder="Renter New Password">
                </li>
     <div class="modal-footer">
            <button type="button" class="btn btn-danger" data-dismiss="modal">Close</button>
                 <?php echo CHtml::ajaxSubmitButton('Reset Password', Yii::app()->createUrl('site/updatePassword'), array(
                            'dataType' => 'json',
                            'type' => 'post',
                            'success' => 'function(data) {
                                if(data.status=="success"){
                                    location.href=$("#liveSite").val()+"index.php?r=site/login";
                              t8.success("Password Changed Successfully","success");
                              
                                } 
                                else 
                                {  
                                    if(data.status=="fail"){
                                        t8.error("Current Password Incorrect. Please Try Again","error");
                                    }
                                    loadPopupModal("site/changepassword","Change Password","lg");
                                } 
                            }',
			'beforeSend' => 'function(){
                            var cur_pwd     = $("#user_current_password").val();
                            var new_pwd     = $("#user_new_password").val();
                            var re_pwd      = $("#user_reenter_password").val();
                            if(cur_pwd=="")
                            {
                                $("#user_current_password").addClass("error");
                                $("#div_changepassword_error").html("Please enter Current Password");
                                return false;
                            }
                            else if(new_pwd=="")
                            {
                                $("#user_current_password").removeClass("error");
                                $("#user_new_password").addClass("error");
                                $("#div_changepassword_error").html("Please enter New Password");
                                return false;
                            }
                            else if(re_pwd=="")
                            {
                                $("#user_current_password").removeClass("error");
                                $("#user_new_password").removeClass("error");
                                $("#user_reenter_password").addClass("error");
                                $("#div_changepassword_error").html("Please Reenter New Password");
                                return false;
                            }
                            else if(re_pwd!=new_pwd)
                            {
                                $("#user_new_password").addClass("error");
                                $("#user_reenter_password").addClass("error");
                                $("#div_changepassword_error").html("Password not matching");
                                return false;
                            }else{
                                $("#user_current_password").removeClass("error");
                                $("#user_new_password").removeClass("error");
                                $("#user_reenter_password").removeClass("error");
                                $("#div_changepassword_error").html("");
                            }
                        }',
		'complete' => 'function(){
                $("#changepassword-form .maintenance-save-btn").prop("disabled", false);
                }'
		), array('id' => 'mybtn' . rand(), 'class' => 'maintenance-save-btn btn btn-primary')); ?>
		
                              </div>           
 <?php $this->endWidget(); ?>    
</ul>   