<form method="post" action="test.htm" onsubmit="return true;" name="tempEmployeeForm" id="Employee_create_gs_temp">
<input type="submit" border="" onclick="this.setAttribute('disabled', 'true');" value="Submit"/>
<input type="button" border="" onclick="javascript:window.location.href='/employee/Employee_search.do'" value="Cancel" name="close"/></form>
上面这段代码在IE6下只会让按钮变灰, 而在FIREFOX中除变灰外, 还会提交表单, 这是为什么?
<input type="submit" border="" onclick="this.setAttribute('disabled', 'true');" value="Submit"/>
<input type="button" border="" onclick="javascript:window.location.href='/employee/Employee_search.do'" value="Cancel" name="close"/></form>
上面这段代码在IE6下只会让按钮变灰, 而在FIREFOX中除变灰外, 还会提交表单, 这是为什么?
onclick="this.setAttribute('disabled', 'true');"
改为
onclick="this.setAttribute('disabled', 'true');return false;"
试试看!
我是想让IE按钮变灰再提交, 现在连firefox都不能提交了
在IE6下还是不能提交表单
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title> new document </title>
<meta name="generator" content="editplus" />
<meta name="author" content="" />
<meta name="keywords" content="" />
<meta name="description" content="" />
</head> <body>
<form method="post" action="test.htm" onsubmit="return true;" name="tempEmployeeForm" id="Employee_create_gs_temp">
<input type="submit" border="" onclick="this.setAttribute('disabled', 'true');this.form.submit();" value="Submit"/>
<input type="button" border="" onclick="javascript:window.location.href='/employee/Employee_search.do'" value="Cancel" name="close"/> </form> </body>
</html>
在 IE 中直接阻止了 form 的提交,与返回值没啥关系!Web 开发常用手册JScript语言参考.rar
http://download.csdn.net/source/308916DHTML参考手册.rar
http://download.csdn.net/source/308913样式表中文手册.chm
http://download.csdn.net/source/304124