document.forms[0]就是网页里第一个form嘛~~
如果没有2个document.forms[1]就会出错~~

解决方案 »

  1.   

    document.forms[0]的0下标 是你的表单索引。
    因为你这个页面只有一个表单 所有是document.forms[0]如果有3个 那么依次是document.forms[0] document.forms[1] document.forms[2]
      

  2.   

    document.forms代表document页面中所有的form对象的集合或者说form数组,[0]也就是第一个form元素。
    你的Html中只有一个form对象,所以只能取document.forms[0]。
    你再添加一个form在</body>前就可以使用document.forms[1]了!
      

  3.   

    非常感谢两位,确实是这样,我试了如果用document.formName也是可以的!!!
      

  4.   

    document.forms[0] 也可以写成 document.forms['form的名字']
      

  5.   

    document form(i) , document all(i)在什么教程有详细介绍?