请指教如下的script是怎么运行的?作用是点击submit以后该按钮就disable 提交以后检测名为 theform 的 form 里所有的元素,如果类型是 submit 或者 reset 就禁止不过这么写很没效率 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 在提交按钮里加一个 onclick="this.disabled=true"例如 <input type="submit" value="提交" onclick="this.disabled = true">reset 按钮给禁止根本一点用都没有,表单已经开始提交了再怎么按 reset 压根没影响了 不能在submit提交的时候就disabled,因为提交以后还要判断是否有内容,有内容才disabled。 指定表单的onsubmit事件的处理onSubmit="return mySubmit();"当返回假(false)时不会提交在自定义的mySubmit()里做提交前的判断 这样怎么加入submit.disabled呢? function submitonce(theform){ if (document.all||document.getElementById) { for (i=0;i<theform.length;i++) { var tempobj=theform.elements[i] if(tempobj.type.toLowerCase() =="submit"||tempobj.type.toLowerCase()=="reset") tempobj.disabled=true } }}<form method="post" name="theform" onsubmit="return submitonce(theform)"> 请问CENTOS如何连接SQL SERVER呢? 紧急求救! 免费下载php开发平台的网址 怎么清除页面之前的所有输出? 用PHP验证用户邮箱 高分求解PHP下拉菜单问题 怎么样5分钟执行一次sql 做聊天室用文本文件代替数据库存数据有什么好处呀? PHPExcel大数据量导出方案 请教php 批量录入数据的问题 chr()??? 如何在执行exec("ping $PingDNS", $Info);后取得一个返回值标记ping的结果?
在自定义的mySubmit()里做提交前的判断
{
if (document.all||document.getElementById)
{
for (i=0;i<theform.length;i++)
{
var tempobj=theform.elements[i]
if(tempobj.type.toLowerCase() =="submit"||tempobj.type.toLowerCase()=="reset")
tempobj.disabled=true
}
}
}
<form method="post" name="theform" onsubmit="return submitonce(theform)">