你好, 请问如何判断下面输入的账号是邮箱地址啊?
<tr> 
  <td width="35%" align="right" height="50"><font size="2.5px" color="#008000"> * 充值账户:</font> </td> 
  <td width="65%" align="left" height="50"> <input name="txt_account" id="txt_account" size="25" value="" /> </td> 
</tr> 
<tr> 


   
  
  <td align="right"><font size="2.5px" color="#008000">* 确认账户:</font> </td> 
  <td align="left"> <input name="txt_raccount" id="txt_raccount" size="25" value="" onpaste='return false' oncontextmenu='return fasle' 
                       onkeypress="return!(event.ctrlKey&&(String.fromCharCode(event.charCode=='v')))"/> </font> </td> 
</tr> <script type="text/javascript"> 
function testCount(){ 
var count1 = document.getElementById("txt_account").value; 
var count2 = document.getElementById("txt_raccount").value; if(count1!=count2){ 
alert("输入的账号不一致,请重新输入"); 
}else{ 
with(document.getElementById("form1")){ 
method="post";
action="zhongzhuan.asp";  
//action="http://billing.ebilling.net.cn/EBrequest.asp"; 
submit(); 



</script> 

解决方案 »

  1.   

    <script type="text/javascript"> 
    function testCount(){ 
    var count1 = document.getElementById("txt_account").value; 
    var count2 = document.getElementById("txt_raccount").value; 
    if(count1.indexof('@163.com')<1)
    {
       alert("请输出网易账号!");}
    if(count1!=count2){ 
    alert("输入的账号不一致,请重新输入"); 
    }else{ 
    with(document.getElementById("form1")){ 
    method="post";
    action="zhongzhuan.asp";  
    //action="http://billing.ebilling.net.cn/EBrequest.asp"; 
    submit(); 



    </script> 
    加了这段好像不行啊
      

  2.   

    if(count1.indexof('@163.com') <1)
    indexOf,o要大写
      

  3.   

    请问下列代码运行时,如果账号输入正确的话浏览器的地址栏里就不出现相关账号 等信息,但是如果账号输入不一致或没有输入账号(邮箱的形式的话),浏览器里就会出现刚才输入的所有信息,这样觉得很危险,该如何避免这种情况 <script type="text/javascript"> 
    function testCount(){ 
    var count1 = document.getElementById("txt_account").value; 
    var count2 = document.getElementById("txt_raccount").value; if(count1.indexOf('@163.com') <1) 

      alert("请输出网易通行证账号!"); 
      return false; 

    if(count1!=count2){ 
    alert("输入的账号不一致,请重新输入"); 
    }else{ 
    with(document.getElementById("form1")){ 
    method="post"; 
    action="zhongzhuan.asp";  
    submit(); 



    </script> 
    </head> 
    <body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" > 
    <form id="form1">     <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> 
      <td width="35%" align="right" height="50"> <font size="2.5px" color="#008000"> * 账号: </font> </td> 
      <td width="65%" align="left" height="50"> <input name="txt_account" id="txt_account" size="25" value="" /> </td> 
    </tr> 
    <tr>   <td align="right"> <font size="2.5px" color="#008000">* 确认账号: </font> </td> 
      <td align="left"> <input name="txt_raccount" id="txt_raccount" size="25" value="" onpaste='return false' oncontextmenu='return fasle' 
                          onkeypress="return!(event.ctrlKey&&(String.fromCharCode(event.charCode=='v')))"/> </font> </td> 
    </tr> 
    <tr> 
    <td height="50" colspan="2" align="center" valign="bottom"> 
    <input type="image" name="sb_next" onclick='testCount()' width="80px" height="20px" src="img/b_next.gif"/> </td> 
    </tr> 
      
        </table> 
    </body> 
    </html>