81,090
社区成员
发帖
与我相关
我的任务
分享
$(function(){
$("#myform").validate({
debug : true, // 取消表单的提交操作
submitHandler : function(form) {
form.submit(); // 提交表单
},
errorPlacement : function(error, element) {
$("#" + $(element).attr("id").replace(".", "\\.") + "Msg").append(error);
},
highlight : function(element, errorClass) {
$(element).fadeOut(1,function() {
$(element).fadeIn(1, function() {
$("#" + $(element).attr("id").replace(".","\\.") + "Div").attr("class","form-group has-error");
});
})
},
unhighlight : function(element, errorClass) {
$(element).fadeOut(1,function() {
$(element).fadeIn(1,function() {
$("#" + $(element).attr("id").replace(".","\\.") + "Div").attr("class","form-group has-success");
});
})
},
errorClass : "text-danger",
rules : {
"eid" : {
required : true
//remote : {
// url : "check.jsp", // 后台处理程序
// type : "post", // 数据发送方式
// dataType : "html", // 接受数据格式
// data : { // 要传递的数据
// code : function() {
// return $("#code").val();
// }
// },
// dataFilter : function(data, type) {
// if (data.trim() == "true")
// return true;
// else
// return false;
// }
//}
} ,
"password" : {
required : true
},
"ename" : {
required : true
} ,
"phone" : {
required : true
},
"jid" : {
required : true
},
"did" : {
required : true
},
"salary" : {
required : true ,
number : true
},
"pic" : {
required : true ,
accept : ["jpg","png","gif","bmp"]
},
"note" : {
required : true
}
}
});
})
public void list(String did) {
IDeptServiceBack deptService=Factory.getServiceInstance("dept.service.back");
JSONArray json=new JSONArray();
try {
List<Dept> arr=deptService.list(did);
for(Dept vo:arr) {
JSONObject obj=new JSONObject();
obj.put("dname", vo.getDname());
json.add(obj);
}
} catch (Exception e) {
e.printStackTrace();
}
}
我是这样传的,不知道对不对,但如何接收我就一脸蒙蔽了,