<div class="row">
    <div class="animated fadeInUp">
        <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 item">
            <div class="panel panel-main panel-form">
                <div class="panel-heading">
                    <h1><i class="fa fa-user fa-fw"></i> <?php echo __('Change Password'); ?></h1>
                </div>
                
                <div class="panel-body content">
                    <form id="UserPasswordForm" action="/users/password/<?php echo $user['User']['id']; ?>" method="post" enctype="multipart/form-data">
                    <div class="row">
                        <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12 form-row">
                            <label for="ProfileFirstName"><?php echo __('New password'); ?></label>
                            <input name="data[User][password]" id="UserPassword" type="password" class="form-control" value="" />
                        </div>
                        <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12 form-row">
                            <label for="ProfileLastName"><?php echo __('Repeat new password'); ?></label>
                            <input name="data[User][password2]" id="UserPassword2" type="password" class="form-control" value="" />
                        </div>
                        <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 text-right form-row">
                            <button type="button" class="btn btn-warning" onclick="window.location='<?php echo $referer; ?>';"><?php echo __('Cancel'); ?></button> <button type="submit" class="btn btn-primary"><?php echo __('Save'); ?></button>
                        </div>
                    </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>

<script type="text/javascript">
$(document).ready(function() {    
    $("#UserPasswordForm").validate({
        rules: {
            'data[User][password]': {
                required: true,
                minlength: 6
            },
            'data[User][password2]': {
                required: true,
                minlength: 6,
                equalTo: "#UserPassword"
            }
        }
    });
});
</script>