<form name=f onsubmit="return mm()"><input type=submit name=send value=submit>function mm()
{
if(判断结果为 true)
{
document.f.send.disabled = true;
return true;
}
else return false;
}
{
if(判断结果为 true)
{
document.f.send.disabled = true;
return true;
}
else return false;
}
解决方案 »
- 请问html编辑器是怎么做的?
- 如何用javascript控制quicktime控件?
- 如何理解javascript中的对象
- 这句代码是什么意思
- firfox中,如何使rangecount大于一,获取选中单元格问题
- 请教:请问这些数的和怎么求?
- 关于动态添加单元格设置样式的问题。
- 简单javascript问题 在线等
- 为什么我用getElementById了,不能获得其下的input
- 请教一个关于Element-admin的路由嵌套问题
- javascript里有没有类似于vbscript中的instr功能的函数
- 用window.self.close();关闭页面时不要出现提示.能否直接关闭就好了.
<form name=f><input type=button name=send value=submit onclick=mm()>function mm()
{
if(判断结果为 true)
{
document.f.send.disabled = true;
f.submit;
}
else return false;
}
<title>定义基础信息库资料</title>
<link href="/style/style.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="/js/shieldmouseright.js"></script>
</head>
<script type="text/javascript" language="Javascript1.1"> <!-- Begin var bCancel = false; function validateTypeForm(form) {
if (bCancel)
return true;
else
return validateRequired(form) && validateMaxLength(form) && validateMinLength(form);
} function required () {
this.aa = new Array("base_name", "库名称不能为空!", new Function ("varName", " return this[varName];"));
} function maxlength () {
this.aa = new Array("base_desc", "作用描述不能多于 50 个字!", new Function ("varName", "this.maxlength='50'; this.minlength='3'; return this[varName];"));
} function minlength () {
this.aa = new Array("base_desc", "作用描述不能少于 3 个字!", new Function ("varName", "this.maxlength='50'; this.minlength='3'; return this[varName];"));
}
</script>
<body class="body_main">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center">
<form name="typeForm" method="post" action="" onsubmit="return validateTypeForm(this)">
<input type="hidden" name="flag" value="">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="height">
<tr>
<td></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="left"><table width="100%" border="0" cellpadding="1" cellspacing="0" class="bgColor1">
<tr>
<td> <table width="100%" border="0" cellpadding="0" cellspacing="1">
<tr align="center">
<td width="30%" height="30" align="right" class="bgColor2">库名:</td>
<td width="70%" height="30" align="left" class="bgColor3">
<input type="text" name="base_name" maxlength="20" size="40" value="" class="input"><font color=red>*</font>
</td>
</tr>
<tr align="center">
<td height="30" align="right" class="bgColor2">作用描述:</td>
<td height="30" align="left" class="bgColor0">
<input type="text" name="base_desc" maxlength="60" size="70" value="" class="input"></td>
</tr>
</table>
<table width="100%" height="55" border="0" bgcolor="#FFFFFF">
<tr>
<td align="center"><input type="submit" name="subok" value="确定" onclick="document.forms[0].flag.value='Create';document.forms[0].subok.disabled = true;document.forms[0].submit();" class="button">
<input type="reset" value="取消" class="button">
</td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
</form></td>
</tr>
</table>
</body></html>
前面的validateTypeForm(form) 是用STRUES自动生成的
<SCRIPT language="javascript">
function checkForm()
{
alert("submit");
}
function subForm()
{
document.forms[0].submit();
//document.all.button1.disabled = true;
setTimeout('document.all.button1.disabled = true',100);
}
</SCRIPT><BODY>
<FORM onSubmit="checkForm()" action="a.html">
<INPUT value="submit" type="submit" id="button1" onClick="subForm()">
</FORM>
</BODY>
</HTML>
好象是反着的,晕