nbsp; public: export javascript script
* 输出 JAVASCRIPT 脚本
\***************************************************************************/
public String ErrorCheckScript() {
this.errorCheckStr +=
"}" + "\n" +
"-->" + "\n" +
"</script>" + "\n";
return this.errorCheckStr;
}
/***************************************************************************\
* public: check the numeric
* 检查录入框值是否是数字
\***************************************************************************/
public void numericCheck(String inputName, String errorMsg) {
this.errorCheckStr +=
" if(fucCheckNUM(document."+formName+"."+inputName+".value) == 0) {" + "\n" +
" alert(\""+errorMsg+".\");" + "\n" +
" document."+formName+"."+inputName+".focus();" + "\n" +
" return(false);" + "\n" +
" }" + "\n\n";
}
/***************************************************************************\
* public: check the length
* 检查录入框值的长度
\***************************************************************************/
public void lengthCheck(String inputName, String errorMsg, int MinLength, int MaxLength) {
this.errorCheckStr +=
" if(fucCheckLength(document."+formName+"."+inputName+".value)<"+MinLength+" || " + "\n" +
" fucCheckLength(document."+formName+"."+inputName+".value)>"+MaxLength+") {" + "\n" +
" alert(\""+errorMsg+".\");" + "
* 输出 JAVASCRIPT 脚本
\***************************************************************************/
public String ErrorCheckScript() {
this.errorCheckStr +=
"}" + "\n" +
"-->" + "\n" +
"</script>" + "\n";
return this.errorCheckStr;
}
/***************************************************************************\
* public: check the numeric
* 检查录入框值是否是数字
\***************************************************************************/
public void numericCheck(String inputName, String errorMsg) {
this.errorCheckStr +=
" if(fucCheckNUM(document."+formName+"."+inputName+".value) == 0) {" + "\n" +
" alert(\""+errorMsg+".\");" + "\n" +
" document."+formName+"."+inputName+".focus();" + "\n" +
" return(false);" + "\n" +
" }" + "\n\n";
}
/***************************************************************************\
* public: check the length
* 检查录入框值的长度
\***************************************************************************/
public void lengthCheck(String inputName, String errorMsg, int MinLength, int MaxLength) {
this.errorCheckStr +=
" if(fucCheckLength(document."+formName+"."+inputName+".value)<"+MinLength+" || " + "\n" +
" fucCheckLength(document."+formName+"."+inputName+".value)>"+MaxLength+") {" + "\n" +
" alert(\""+errorMsg+".\");" + "
| 对此文章发表了评论 |
