首页/技术开发/内容

用 JSP 在客户端生成 JavaScript 代码来完成表单校验

技术开发2023-08-22 阅读()
(tmpd.length>2)) {" + "\n" +
"return 0;" + "\n" +
"}" + "\n" +
"if (!((1<=month) && (12>=month) && (31>=day) && (1<=day)) ) {" + "\n" +
"return 0;" + "\n" +
"}" + "\n" +
"if (!((year % 4)==0) && (month==2) && (day==29)) {" + "\n" +
"return 0;" + "\n" +
"}" + "\n" +
"if ((month<=7) && ((month % 2)==0) && (day>=31)) {" + "\n" +
"return 0;" + "\n" +
"}" + "\n" +
"if ((month>=8) && ((month % 2)==1) && (day>=31)) {" + "\n" +
"return 0;" + "\n" +
"}" + "\n" +
"if ((month==2) && (day==30)) {" + "\n" +
"return 0;" + "\n" +
"}" + "\n" +
"return 1;" + "\n" +
"}" + "\n\n";

}

/*public static void main(String[] args) {
ErrorCheck ec = new ErrorCheck("testFrom");
String script = ec.ErrorCheckScript();
System.out.println(script);
} */

}

第1页  第2页  第3页  第4页  第5页  第6页  第7页  第8页  第9页 

……

相关阅读