请指教如下的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)"> 怎样重定义常量? filesize函数,求解析、 问下 php+ajax 怎么样让html的静态页面显示数据库内容啊? 关于一个smarty的问题!!! 今天头一次接触php,有些超级基础的问题。请大家耐心 如何实现自动分类! 毕业设计不知道做什么好,郁闷ing~~~~ 求救 各位老大,给解决个低级问题!(在线等待) 求指教,求第二大的数 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)">