﻿function ckform()
{
   var title=jQuery.trim($("#txt_title").attr("value"));
   var name=jQuery.trim($("#txt_name").attr("value"));
   var email=jQuery.trim($("#txt_email").attr("value"));
   var phone=jQuery.trim($("#txt_phone").attr("value"));
   var content=jQuery.trim($("#txt_content").attr("value"));
   if(email.length>0)
   {
       
        if(!isEmail(email))
        {    
         alert('输入正确的E-mail地址');
         $("#txt_email").attr("value","");
         return false; 
        }                                   
        
   }
   if(phone.length==0)
   {
      alert('请留下您的联系电话！');
      $("#txt_phone").focus();   
      return false;                                                                
   }
   if(content.length<6)
   {
      alert('留言内容不应少于6个字符');
       $("#txt_content").focus();
      return false;
     
   }  
   
}
function isEmail(strEmail) {
if (strEmail.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1)
return true;
else
false
}
