|
1 # 大 中 小 发表于 2008-05-08 22:09:05
document.forms[0],得不到文本框的值,没错误提示的错误
我测试错误信息,可是我明明往文本框里输入值了,却告诉我没输入值,还不报错,我就找原因,检查了好几遍,也没找出错误,最后定位在document.forms[0],因为我的一个jsp里有好几个form表单,我那个得不到值的是最后一个表单,第4个,我就把document.forms[0]改成了document.forms[1],这样就得到值了
document.forms[0]的0下标 是表单索引。
因为这个页面有四个表单 所以是document.forms[0] document.forms[1] document.forms[2]document.forms[3] ,第一个表单document.forms[0], 第2个document.forms[1]依次类推
如果只有1个 那么是document.forms[0]
http://heisetoufa.ggblog.com
1群:5302559
2群:5358308
3群:43605976
4群:43605925(
|