<script type="text/javascript">
$("#advquerytow").validate(
{
// 验证规则
rules:
{
title:{
required:true,
minlength:2,
remote: {
url: "${pageContext.request.contextPath}/topic/ajaxchecking.htm?temp="+Math.random()+"", //后台处理程序
type: "post", //数据发送方式
dataType: "json", //接受数据格式
}
}
},
// 验证提示信息(失败时)
message:{},
// 成功时执行
success: function(label)
{
label.text(" ") // 将错误内容清空,一定要是" "有空格,否则IE有问题。
.addClass("success");
alert("Submitted!");
}
});
</script>
public ModelAndView ajaxchecking(HttpServletRequest request,
HttpServletResponse response) throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
String rand = (String) request.getSession().getAttribute("com.tabhi.rand");
Map model = new HashMap();
boolean result = true;
System.out.println("ajaxchecking");
model.put("result", result);
return setJsonResult(model);
}
无法提交表单确定以执行ajaxchecking、 如果把 remote去掉就可以提交、 求助 !
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货