一个关于onsubmit的问题 为什么要 document.write 去掉这句看看 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 document.write重写了页面之后还怎么提交?? function message3() { document.write("hello"); return true; } 你改成function message3() { alert("hello");//document.write("hello"); return true; } 就可以 因为你是在页面已经加载完毕之后对页面进行的document.write操作 它将会重构页面 也就是说你的form已经不存在了 哪来的提交你试试这个代码function message3() { alert(document.forms.length);//alert("hello");document.write("hello"); alert(document.forms.length); //得到的是0 也就是form已经不存在了return true; } 不要用document.write("hello"); 它会把当前页的内容抹掉因此即使return true,也不会action到你指定的那个页面 6楼讲得很清楚了,楼主这个不是onsubmit的问题,应该是文档未载入和已载入后document.write()的区别问题。 无法实现页面跳转 extjs的一个问题 javascript 方法能否返回键值对应的值 iframe问题 javascript浮动菜单的问题 “4-20个字符(其中包括 A-Z,a-z,0-9)且不能为空”这个正则表达式怎么写? 部署nodejs项目出现listen EADDRNOTAVAIL错误 求一去掉某字符串首尾空格的函数 怎么用window.open新建一个窗口,并屏蔽掉关闭按钮 如何让某一页面显示在ShowModalDialog()打开的窗口中 js 中伪类是什么意思啊? 我第一次用Dreamweaver4 怎么使用Dreamweaver 4.03中文版?希望高手们给予帮助
function message3() {
document.write("hello");
return true;
} 你改成
function message3() {
alert("hello");
//document.write("hello");
return true;
} 就可以
alert(document.forms.length);
//alert("hello");
document.write("hello");
alert(document.forms.length); //得到的是0 也就是form已经不存在了
return true;
}
它会把当前页的内容抹掉因此即使return true,也不会action到你指定的那个页面