p; * 检查录入框值是否是YYYY-MM-DD的日期格式
\***************************************************************************/
public void dateCheck(String inputName, String errorMsg) {
this.errorCheckStr +=
" if(chkdate(document."+formName+"."+inputName+".value) == 0) {" + "\n" +
" alert(\""+errorMsg+".\");" + "\n" +
" document."+formName+"."+inputName+".focus();" + "\n" +
" return(false);" + "\n" +
" }" + "\n\n";
}
public void neededFunction() {
this.errorCheckStr +=
"//函数名:fucCheckNUM" + "\n" +
"//功能介绍:检查是否为数字" + "\n" +
"//参数说明:要检查的数字" + "\n" +
"//返回值:1为是数字,0为不是数字" + "\n" +
"function fucCheckNUM(NUM) {" + "\n" +
" var i,j,strTemp;" + "\n" +
" strTemp=\"0123456789\";" + "\n" +
" if ( NUM.length == 0) return 0;" + "\n" +
" for (i=0;i<NUM.length;i++) {" + "\n" +
" j = strTemp.indexOf(NUM.charAt(i));" + "\n" +
" if (j==-1) {" + "\n" +
" //说明有字符不是数字" + "\n" +
" return 0;" + "\n" +
" }" + "\n" +
" }" + "\n" +
" //说明是数字" +
\***************************************************************************/
public void dateCheck(String inputName, String errorMsg) {
this.errorCheckStr +=
" if(chkdate(document."+formName+"."+inputName+".value) == 0) {" + "\n" +
" alert(\""+errorMsg+".\");" + "\n" +
" document."+formName+"."+inputName+".focus();" + "\n" +
" return(false);" + "\n" +
" }" + "\n\n";
}
public void neededFunction() {
this.errorCheckStr +=
"//函数名:fucCheckNUM" + "\n" +
"//功能介绍:检查是否为数字" + "\n" +
"//参数说明:要检查的数字" + "\n" +
"//返回值:1为是数字,0为不是数字" + "\n" +
"function fucCheckNUM(NUM) {" + "\n" +
" var i,j,strTemp;" + "\n" +
" strTemp=\"0123456789\";" + "\n" +
" if ( NUM.length == 0) return 0;" + "\n" +
" for (i=0;i<NUM.length;i++) {" + "\n" +
" j = strTemp.indexOf(NUM.charAt(i));" + "\n" +
" if (j==-1) {" + "\n" +
" //说明有字符不是数字" + "\n" +
" return 0;" + "\n" +
" }" + "\n" +
" }" + "\n" +
" //说明是数字" +
| 对此文章发表了评论 |
