*******************************************\
* public: check if the input value contian the prefered string
* 检查录入框值是否是包含给定字串
\***************************************************************************/
public void stringCheck(String inputName, String errorMsg, String string) {
this.errorCheckStr +=
" if(document."+formName+"."+inputName+".value.indexOf(\""+string+"\") != 0) {" + "\n" +
" alert(\""+errorMsg+".\");" + "\n" +
" document."+formName+"."+inputName+".focus();" + "\n" +
" return(false);" + "\n" +
" }" + "\n\n";
}
/***************************************************************************\
* public: check if the input value contain the denyed string
* 检查录入框值是否是包含给禁止的字串
\***************************************************************************/
public void denyStrCheck(String inputName, String errorMsg, String string) {
this.errorCheckStr +=
" if (document."+formName+"."+inputName+".value.length == 0 || " + "\n" +
" document."+formName+"."+inputName+".value.indexOf(\""+string+"\") != -1) {" + "\n" +
" alert(\""+errorMsg+".\");" + "\n" +
" document."+formName+"."+inputName+".focus();" + "\n" +
" return(false);" + "\n" +
" }" + "\n\n";
}
/***************************************************************************\
* public: check the YYYY-MM-DD format date
&nbs
* public: check if the input value contian the prefered string
* 检查录入框值是否是包含给定字串
\***************************************************************************/
public void stringCheck(String inputName, String errorMsg, String string) {
this.errorCheckStr +=
" if(document."+formName+"."+inputName+".value.indexOf(\""+string+"\") != 0) {" + "\n" +
" alert(\""+errorMsg+".\");" + "\n" +
" document."+formName+"."+inputName+".focus();" + "\n" +
" return(false);" + "\n" +
" }" + "\n\n";
}
/***************************************************************************\
* public: check if the input value contain the denyed string
* 检查录入框值是否是包含给禁止的字串
\***************************************************************************/
public void denyStrCheck(String inputName, String errorMsg, String string) {
this.errorCheckStr +=
" if (document."+formName+"."+inputName+".value.length == 0 || " + "\n" +
" document."+formName+"."+inputName+".value.indexOf(\""+string+"\") != -1) {" + "\n" +
" alert(\""+errorMsg+".\");" + "\n" +
" document."+formName+"."+inputName+".focus();" + "\n" +
" return(false);" + "\n" +
" }" + "\n\n";
}
/***************************************************************************\
* public: check the YYYY-MM-DD format date
&nbs
| 对此文章发表了评论 |
