请高手帮我改一下这个formcheck.js文件,感谢!
我新手都不算,完全不懂,就像去掉分类信息发布页面的EMAIL和TAG的检测,使用户不用填写也能发信息,l谢谢了。
var ValidFone = false;
var CheckQQ = false;
function gid(x) { return document.getElementById(x); }
function clearMe(x) { document.getElementById( 'info_ '+x+ '_hint ').innerHTML = ' ';}
function IsNumeric(sText) {
var ValidChars = "0123456789- ";
var IsNumber=true;
var Char;
for (i = 0; i < sText.length && IsNumber == true; i++)
{
Char = sText.charAt(i);
if (ValidChars.indexOf(Char) == -1)
{
IsNumber = false;
}
}
return IsNumber;
}
function isEmail(email) {
invalidChars = " ~\ '^\`\ "*+=\\|][(){}$&!#%/:,; ";
// Check for null
if (email == " ") {
return true;
}
// Check for invalid characters as defined above
for (i=0; i <invalidChars.length; i++) {
badChar = invalidChars.charAt(i);
if (email.indexOf(badChar,0) > -1) {
return false;
}
}
lengthOfEmail = email.length;
if ((email.charAt(lengthOfEmail - 1) == ". ") || (email.charAt(lengthOfEmail - 2) == ". ")) {
return false;
}
Pos = email.indexOf( "@ ",1);
if (email.charAt(Pos + 1) == ". ") {
return false;
}
while ((Pos < lengthOfEmail) && ( Pos != -1)) {