页面无法提交!

hewei2003 2010-12-05 12:19:24
做一个短信的二次开发,为了不让用户重复提交,在提交时做了些处理,但是现在条件都成立却无法提交了
<%@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> </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>
...全文
70 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
Mr-Jee 2010-12-05
  • 打赏
  • 举报
回复
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
}
shasha8023 2010-12-05
  • 打赏
  • 举报
回复
貌似不会。。。。

87,904

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧