<html>
<head>
<script language="javascript" >
function executeit()
{
document.testfrm.btn_submit.disabled=true;
return 1;
}
</script>
</head>
<body>
<table>
<form name ="testfrm" action="submitpage.asp" onsubmit="return executeit()">
<input name="content" type="text" width="100" >
<hr>
<input name="btn_submit" type="submit" >
</form>
</table>
</body>
</html>
<head>
<script language="javascript" >
function executeit()
{
document.testfrm.btn_submit.disabled=true;
return 1;
}
</script>
</head>
<body>
<table>
<form name ="testfrm" action="submitpage.asp" onsubmit="return executeit()">
<input name="content" type="text" width="100" >
<hr>
<input name="btn_submit" type="submit" >
</form>
</table>
</body>
</html>
解决方案 »
- WScript.Shell的那些奇怪事情,一年了还没搞懂
- var WshShell=new ActiveXObject("WScript.Shell")用法疑惑
- jw player进度条禁止拖动
- 紧急:如何用js遍历多个xml文件,一一取值
- dojo.require("dojo.date")这个怎么用?dojo.date可以用来做什么呢?
- 大家帮着看一看吧!
- http://sports.163.com/图片改这改变的?
- div 的位置是怎么定的?
- 怎样在script中修改表中某单元格的内容
- 大家来说说那个UI比较好呢,我现在用的是easy ui
- 请INPUT的属性为READONLY,我想在添入一个数值进去INPUT的时候触发事件,请问是哪个事件呢?
- 请好心的哥哥姐姐叔叔婶婶帮忙测试,先谢了!
如果用onSubmit="return function();",function中还可以通过return false阻止表单提交。
<!--
function input(ok)
{
var M1=ok.ReplyContent.value;
if (M1=='') {
alert('回复内容不可以为空.');
return false;
}
ok.B1.disabled =true;
ok.B2.disabled =true;
return true;
}
//-->
</script>
<head>
<script language="javascript">
<!--
function input(test)
{
var M=test.name.value;
if(M==''){
alert('内容不可以为空.');
return false;
}
test.A.disabled =true;
test.B.disabled =true;
return true;
}
//-->
</script>
</head>
<body>
<table width="452" height="159" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<form name ="test" action="" onsubmit="return input(test)">
<input name="name" type="text" width="100" ><input name="A" type="submit" value="提交">
<input name="B" type="reset" value="重置">
</form>
</td>
</tr>
</table>
</body>
</html>