一个关于onsubmit的问题
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml/DTD/xhtml1-transitional.dtd">
<html xmlns = "http://www.w3.org/1999/xhtml" xml:lang = "en" lang = "en">
<head>
<title>onsubmit event</title>
<script type = "text/javascript">
function writeMessage() {
document.getElementById('text2').value = document.getElementById('text1').value;
}
function message1() {
return false;
}
function message2() {
return true;
}
function message3() {
document.write("hello");
return true;
}
</script>
</head>
<body>
<p>The onkeydown event occurs when the a keybord key is on its way UP</p>
<form onsubmit = "return message3()" action = "http://www.hao123.com">
Enter something:
<input type = "text" id = "text1" onkeyup = "writeMessage()" /> <!-- 当是onkeydown时 text1中最后按下的那个字符还没有给text2所发两个文本框相差一个字符 keyup才表示一个输入完成 -->
<input type = "text" id = "text2" />
<input type = "submit" value = "提交">
</form>
</body>
</html>
message3() 的返回值是true为什么不提交到http://www.hao123.com这个页面呢?反而跳到了另一个页面,最好能详细的讲解一下