jquery Email phone number, fax URL regular verification
var Str=frm.orgphone.value;
var reg=/(^[0-9) ... {3,4}-[0-9] ... {3,8}$) | (^[0-9] ... {3,8}$) | (^ ([0-9] ... {3,4}) [0-9]. {3,8}$) | (^0 ...) {0,1}13[0-9] ... {9}$)/;
if (isNaN (str)) {
if (Reg.test (str) ==false) {
Alert ("Enter the phone number incorrectly, please re-enter!");
Frm.orgphone.value= "";
Frm.orgphone.focus ();
return false;
}
}
Web site Verification
var pattern=new regexp ((^http) | ( ^https Tutorial) | (^FTP)):/ /(W) +. (W) + ");
if (Pattern.test (Frm.orgurl.value)) {...}
else{
Alert ("The URL entered is not a valid format!");
Frm.orgurl.focus ();
return false;
}
Fax number Verification
var reg=/(^[0-9) ... {3,4}-[0-9] ... {3,8}$) | (^[0-9] ... {3,8}$) | (^ ([0-9] ... {3,4}) [0-9]. {3,8}$) | (^0 ...) {0,1}13[0-9] ... {9}$)/;
if (isNaN (str)) {
if (Reg.test (str) ==false) {
Alert ("Fax input is incorrect, please re-enter!");
Frm.orgfax.value= "";
Frm.orgfax.focus ();
return false;
}
}
Phone number Verification
var reg=/(^[0-9) ... {3,4}-[0-9] ... {3,8}$) | (^[0-9] ... {3,8}$) | (^ ([0-9] ... {3,4}) [0-9]. {3,8}$) | (^0 ...) {0,1}13[0-9] ... {9}$)/;
if (isNaN (str)) {
if (Reg.test (str) ==false) {
Alert ("Enter the phone number incorrectly, please re-enter!");
Frm.orgphone.value= "";
Frm.orgphone.focus ();
return false;
}
}