做一个短信的二次开发,为了不让用户重复提交,在提交时做了些处理,但是现在条件都成立却无法提交了
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<script>
function submit2(obj_form,obj_submit){
   
   if(!check_send()) return false; 
    obj_submit.value='发送中......' 
    obj_submit.disabled=true; 
    obj_form.submit(); 
  
}function check_send()
{
   if (form1.phone_number.value.length<9){
     alert('请输入规范的手机号码!');
 document.form1.phone_number.focus();
     return false;
   }
   
   if (form1.content.value.length<3){
      alert("发送短信内容不能少于3个字!");
document.form1.content.focus();
return false;
   }
   if (form1.content.value.length>70){
      alert("发送短信内容不能大于70个字符!");
document.form1.content.focus();
return false;
   }
}function ContentChange(){
var len=form1.content.value.length;
var ts=parseInt(len/70);
var ys=parseInt(len%70);
if (ys>0){
//ts+=1;
}
document.all.LabZshu.innerHTML="("+len+"<font color=red>个字符</font>)";
}

</script>
<body>
<form id="form1" name="form1" method="post" action="send_message.asp">
  <table width="738" height="198" border="0" align="center" cellspacing="10">
    
<tr>
      <td width="127"><div align="right">手机号码:</div></td>
      <td width="577"><input name="phone_number" type="text" size="40" /></td>
    </tr>


    <tr>
      <td><div align="right">内容:</div></td>
      <td><label>
        <textarea name="content" id="content" cols="40" rows="10" onpaste="javascript:ContentChange()" onkeyup="javascript:ContentChange()"></textarea>
        <span class="number_02 blue" id="LabZshu"><span id="LabSendInfo" style="color:Red;"></span></span>
      </label></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td><label>
        <input type="button" name="Submit1" id="Submit1" value="发送" onClick="submit2(document.getElementById('form1'),document.getElementById('Submit1'));">

        <input type="hidden" name="nav" value="ok"/>
      </label></td>
    </tr>
  </table>
</form>
</body>
</html>

解决方案 »

  1.   

    function check_send()
    {
      if (form1.phone_number.value.length<9){
      alert('请输入规范的手机号码!');
    document.form1.phone_number.focus();
      return false;
      }
        
      if (form1.content.value.length<3){
      alert("发送短信内容不能少于3个字!");
    document.form1.content.focus();
    return false;
      }
      if (form1.content.value.length>70){
      alert("发送短信内容不能大于70个字符!");
    document.form1.content.focus();
    return false;
      }
      return true
    }