mail检查格式代码

 <script   language="javascript">
           function   ismail(mail)
            {
                return(new   RegExp(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/).test(mail));
           }
  function CheckEmail(Email)
   {
    if (!ismail(Email))
    {
     alert("Email error!");
     return false;
   }
   }
</script>
 
 
 
 
 <SCRIPT>
 
 function ywm1() {

 var t;

 aa=document.all.select.value;

// alert(aa);
   switch (aa) {

  case '傾儗僋僒儞僟乕(Alexander)' :
        t=140;
        break;

  case '僇乕僶儞僋儖(Carbuncle)' :
        t=140;
        break;

    case '働儖儀儘僗(Cerberus)' :
        t=140;
        break;

  case '働僢僩僔乕(Caitsith)' :
        t=140;
        break;

  case '僼僃傾儕乕(Fairy)' :
        t=140;
        break;

  case '僼僃儞儕儖(Fenrir)' :
        t=140;
        break;

  case '僙僀儗乕儞(Siren)' :
        t=140;
        break;

  case '償傽儖僼傽乕儗(Valefor)' :
        t=140;
        break;
  
  default:
           t=120;
    }
  
      document.all.textfield3.value =  document.all.textfield2.value*t;
 
 }
 
 
function ywm() {

//alert(aa);

 aa=document.all.select.value;
    switch (aa) {
 
  case '傾儗僋僒儞僟乕(Alexander)' :
        t=140;
        break;

  case '僇乕僶儞僋儖(Carbuncle)' :
        t=140;
        break;

    case '働儖儀儘僗(Cerberus)' :
        t=140;
        break;

  case '働僢僩僔乕(Caitsith)' :
        t=140;
        break;

  case '僼僃傾儕乕(Fairy)' :
        t=140;
        break;

  case '僼僃儞儕儖(Fenrir)' :
        t=140;
        break;

  case '僙僀儗乕儞(Siren)' :
        t=140;
        break;

  case '償傽儖僼傽乕儗(Valefor)' :
        t=140;
        break;
  
  default:
           t=120;
    }
  

 

   if (document.all.textfield2.value>=0 && document.all.textfield2.value<=99)
   {
      document.all.textfield3.value =  document.all.textfield2.value*t;
   }
   if (document.all.textfield2.value>=100 && document.all.textfield2.value<=299)

   {   document.all.textfield3.value = document.all.textfield2.value*t;
      }
  
   if (document.all.textfield2.value>=300 )
   {
   document.all.textfield3.value = document.all.textfield2.value*t;
   }
  }
 
 
 
   String.prototype.Trim = function()
{
return this.replace(/(^\s*)|(\s*$)/g, "");
}
 
 
 
 
 function checkform() {

if (form1.textfield.value.Trim() == "") {
alert("僊儖戭攝愭僉儍儔僋僞");
return false; }
if (form1.textfield2.value.Trim()== "") {
alert("峸擖婓朷岥悢");
return false; }
if (form1.textfield3.value.Trim() == "") {
alert("嬥妟");
return false; }

if (form1.textfield4.value.Trim() == "") {
alert("偍巟暐偄柤");
return false; }
 
if (form1.textfield6.value.Trim() == "") {
alert("儊乕儖傾僪儗僗");
return false; }

if (!ismail(form1.textfield6.value.Trim().replace(/^\s*|\s*$/,"")))
{
 alert("Email error!");
 return false;
}

else

 { return true; }
}


 
</SCRIPT>

posted @ 2006-03-20 19:32  Winner.Net(2007)  阅读(644)  评论(0编辑  收藏  举报