一个关于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()的区别问题。 谁有比较好的javascript视频教程啊 js正则替换怎样获取内存()内容? 如何在JS里获得客户端的IP地址? js 获得html参数并赋值给一个document对象 怎样通过一个下拉框控制表中某一行的隐藏和显示? 关于checkbox全选功能和选择器有关的问题 提一个小问题,50分相送 为什么这个日期选择框这么奇怪啊?请教各位大虾 怎样在IE打开的时候用JS隐藏IE的工具条 仿制jNotify插件api时,jquery获取表单数据失败,求大神指点 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到你指定的那个页面