var AccountAdd = function () {

    var initForm = function () {
        var initFormCtrl = function () {
            bindEvent();
        };


        var bindEvent = function() {
            $("#accountForm").validate({
                rules: {
                	appid: {
                        required: true,
                        htmlescape: true
                    },
                    secret: {
                    	required: true,
                        htmlescape: true
                    },
                    token: {
                        htmlescape: true
                    },
                    encodingaeskey:{
                    	htmlescape:true
                    }
                    
                },
                messages: {
                	appid: {
                        htmlescape: "请您不要输入特殊字符!"
                    },
                    secret: {
                        htmlescape: "请您不要输入特殊字符!"
                    },
                    token: {
                        htmlescape: "请您不要输入特殊字符!"
                    },
                    encodingaeskey:{
                    	htmlescape: "请您不要输入特殊字符!"
                    }
                },
                submitHandler: function (form) 
                {
                	var password;
                    var formdata = 
                    {
                    	appid:$("#appid").val(),
                    	secret:$("#secret").val(),
                    	token:$("#token").val(),
                        description:$("#description").val(),
                        encodingaeskey:$("#encodingaeskey").val()
                    };
                   // console.log(formdata);
                    formSubmit(formdata);
                }
        }); }

        initFormCtrl();
    };

    return {

        //main function to initiate the module
        init: function () {
            initForm();
        }

    };

}();