sustainType : function(id,setting)
{
var elem = $("#"+id).get(0);
var srcTag = elem.tagName;
var stype = elem.type;
switch(setting.validateType)
{
case "InitValidator":
return true;
case "InputValidator":
return (srcTag == "INPUT" || srcTag == "TEXTAREA" || srcTag == "SELECT");
case "CompareValidator":
return ((srcTag == "INPUT" || srcTag == "TEXTAREA") ? (stype != "checkbox" && stype != "radio") : false);
case "AjaxValidator":
return (stype == "text" || stype == "textarea" || stype == "file" || stype == "password" || stype == "select-one");
case "RegexValidator":
return ((srcTag == "INPUT" || srcTag == "TEXTAREA") ? (stype != "checkbox" && stype != "radio") : false);
case "FunctionValidator":
return true;
}
},
if(validatorGroup == undefined){validatorGroup = "1"};
var initConfig = $('body').data(validatorGroup);
$.each(initConfig.validObjects,function(){
var elem = this.get(0);
var setting = elem.settings[0];
var passed = setting.defaultPassed;
$.formValidator.setTipState(elem, passed ? "onCorrect" : "onShow", passed ? setting.onCorrect : setting.onShow);
});
//验证成功后,如果没有设置成功提示信息,则给出默认提示,否则给出自定义提示;允许为空,值为空的提示
showmsg = $.formValidator.isEmpty(id) ? setting.onEmpty : setting.onCorrect;
//定位漂浮层
localTooltip : function(e)
{
e = e || window.event;
var mouseX = e.pageX || (e.clientX ? e.clientX + document.body.scrollLeft : 0);
var mouseY = e.pageY || (e.clientY ? e.clientY + document.body.scrollTop : 0);
$("#fvtt").css({"top":(mouseY+2)+"px","left":(mouseX-40)+"px"});
},