< SCRIPT type="text/javascript">
varredflag=0;
// Name Verification
functionisname(){
varname=$(' #name '). Val ();
if(name. Search (/^[\u0391-\uffe5\w]+$/)!=-1) {
redflag=0;
returntrue;
}
Else {
alert (" Malformed name");
redflag=1;
returnfalse;
}
}
// Mailbox Verification
functionisemail(){
varemail=$(' #email '). Val ();
if(email. Search (/^ ([a-za-z0-9]+[_|_|.]?) *[a-za-z0-9][email protected] ([a-za-z0-9]+[_|_|.]?) *[a-za-z0-9]+\. (?: COM|CN) $/)! =-1) {
//if (Email.search (/^ ([a-za-z0-9]+[_|\_|\.]?) *[a-za-z0-9][email protected] ([a-za-z0-9]+[_|\_|\.]?) *[a-za-z0-9]+\.+[c][o][m]$| C [n]$/)! =-1) {
//if (Email.search (/^ ([a-za-z0-9]+[_|\_|\.]?) *[a-za-z0-9][email protected] ([a-za-z0-9]+[_|\_|\.]?) *[a-za-z0-9]+\. [A-za-z] {2,3}$/)! =-1) {
//if (Email.search (/^.+\@ (\[?) [A-za-z0-9\-\.] +\. ([a-za-z]{2,3}| [0-9] {1,3}) (\]?) $/)! =-1) {
//if (Email.search (/^\w+ (-\w+) | ( \.\w+)) *\@[a-za-z0-9]+ ((\.| -) [a-za-z0-9]+] *\. [a-za-z0-9]+$/)! =-1) {
redflag=0;
returntrue;
}
Else {
alert (" bad mailbox Format");
redflag=1;
returnfalse;
}
}
// Verify phone number
functionfucchecktelphone()
{
vartelphone=$(' #telephone '). val();
if(telphone. Search (/^ ([0\+]\d{2,3}-)? ( 0\d{2,3})? (\d{7,8}) (-(\d{3,}))? $/)!=-1) {
redflag=0;
returntrue;
}
Else {
alert (" wrong phone format");
redflag=1;
returnfalse;
}
}
// Verify your phone number
functionfucchecktel()
{
varTel=$(' #tel '). Val ();
if(Tel. Search (/^ ((13[0-9]{1}) | ( 15[0-9]{1}))) +\d{8}) $/)!=-1) {
redflag=0;
returntrue;
}
Else {
alert (" phone format error");
redflag=1;
returnfalse;
}
}
// verify QQ
functionisqq()
{
varqq=$(' #qq '). Val ();
if(QQ. Search (/^[1-9]\d{4,8}$/) != - 1 ){
redflag=0;
returntrue;
}
Else {
alert ("QQ format error");
redflag=1;
returnfalse;
}
}
//msn Verification-(as with the mailbox)
functionismsn()
{
varmsn=$(' #msn '). Val ();
if(msn. Search (/^\w+ (-\w+) | ( \.\w+)) *\@[a-za-z0-9]+ ((\.| -) [a-za-z0-9]+] *\. [a-za-z0-9]+$/)!=-1) {
redflag=0;
returntrue;
}
Else {
alert ("MSN format Error");
redflag=1;
returnfalse;
}
}
// Birthday Verification
functionisbirthday()
{
varDay=$(' #birthday '). Val ();
if(day. Search (/\d{1,4}\-\d{1,2}\-\d{1,2}/) != - 1 ){
//varzzbds= "([0-9]{3}[1-9]|[ 0-9]{2}[1-9][0-9]{1}| [0-9] {1} [1-9] [0-9] {2}| [1-9] [0-9] {3}) -(((0[13578]|1[02))-(0[1-9]|[ 12][0-9]|3[01]) | ((0[469]|11)-(0[1-9]|[ 12][0-9]|30)) | (02-(0[1-9]|[ 1][0-9]|2[0-8]))) | (([0-9]{2}) (0[48]|[ 2468][048]| [13579] [26]) | ((0[48]| [2468] [048]| [3579] [26]) (xx)) -02-29) ";
//if (Day.search (ZZBDS)! =-1)
redflag=0;
returntrue;
}
Else {
alert (" bad Birthday format");
redflag=1;
returnfalse;
}
}
function NextStep () {
//if (redflag==0) {
// document.form0.submit ();
//}else{
// return;
//}
if(isname()&&isbirthday() &&isemail()&&fucchecktelphone() && Fucchecktel ()&&isqq()&&ismsn() ){
document. Form0 . Submit ();
}else{
return;
}
}
</ SCRIPT >