表单中的t:comboTree如何增加验证
表单中的t:comboTree如何增加验证 目前自己是在onBeforeSelect 事件写验证方法,希望高手有更好的方法贴出共享一下$('#gsParentid').combotree({
url : "",
panelHeight: 200,
width: 170,
onBeforeSelect :function(node){
validResult = false;
var validMessage = "";
var validData = new Object();
validData["gsParentId"] = node.id;
validData["gsId"] = $("#id").val();
$.ajax({
type: "get",
url: "venGoodsSortController.do?verifyParentId",
datatype: "json",
data: validData,
cache: false,
success: function(data) {
validResult = data["action"];
validMessage = data["message"];
},
async: false
});
var obj = $("#gsParentid").parent().find(".Validform_checktip");
if(validResult) {
obj.text(validMessage);
obj.removeClass("Validform_wrong");
obj.addClass("Validform_right");
}
else {
obj.text(validMessage);
obj.removeClass("Validform_right");
obj.addClass("Validform_wrong");
}
obj.show();
return true;
}
});
页:
[1]