<head>
<title></title>
<script type="text/javascript">
function Show() {
var value = document.getElementById("username").value;
alert(value);
return false;
}
</script></head>
<form id="form1" action="Ok.aspx" onsubmit="Show()">
label for="username">用户名:</label><input id="username" type="text" />
<input type="submit" value="提交" />
</form>
在IE中运行时,点提交后,弹出对话框,但我return false,页面还是提交了,请教这段代码哪里有问题 |
|