/**
 * Created by xiawenlong on 15/9/10.
 */
$(function () {
    //注册验证
    $('#register-form').html5Validate(function () {
        $(this).submit();
    });
    //检测E-mail是否存在
    $('#User_email').bind('blur',function() {
        var $this = $(this),
            email = $this.val();
        $.ajax({
            type: 'POST',
            dataType: 'json',
            data:{email:email},
            url: '/account/checkEmail',
            success: function(data){
                if(data.status && $.testRemind.display == false) {
                    $this.testRemind("该Email已存在");
                    $this.attr('placeholder',email).val('');
                }
            }
        });
    });
    //登录验证
    $('#login-form').html5Validate(function () {
        $(this).submit();
    });
});