month = new var_to_obj(m); day = new var_to_obj(d); days = getDaysInMonth(month.value,year.value) + 1;
if ( (is_greater(day,-1,0))&&(is_less(day,-1,days))&& (is_greater(month,-1,0))&&(is_less(month,-1,13))&& (is_greater(year,-1,1900))&&(is_less(year,-1,2500)) ) Ret=true; } } if (!Ret) doCritCode(field,crit,msg);
return(Ret); }
function doCrit(field,crit,msg) { if ( (-1!=crit) ) { alert(msg); if (crit==1) { field.focus(); // focus does not work on certain netscape versions } } } // 判断是否有有效数据被选中 function isselected(field,crit,msg) { value=""+field.options[field.selectedIndex].value; if(value=="0") Ret=false; else Ret=true; if (!Ret) doCrit(field,crit,msg); return(Ret); }
// 检查是否是字符 // cCharacter:输入值 function isCharacter( cCharacter ) { var sFormat = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";