try it:function read(){
  for (i=0;i<form1.elements.length;i++){
   curname=form1.elements[i].name;
   curvalue=form1.elements[i].value;
  }
}

解决方案 »

  1.   

    改成.
    function read(){
      for (i=0;i<document.all.form1.elements.length;i++){
       curname=document.all.form1.elements[i].name
       curvalue=document.all.form1.elements[i].value
      }
    }另外.必须在<form name=form1>之后调用该函数.不然也会报没有对象的错误.
      

  2.   

    do you have a form named "form1"? check the case
      

  3.   

    第一:
    是否有一个form叫form1?
    第二:
    去掉document.form1中的document.直接写form1      //错误最有可能在这里。
    第三:
    对read函数的引用是不是在form1对象已经生成了之后?
      

  4.   

    document.forms.children[i]
    document.forms.children.length
    它包括submit和reset按钮以及一切在form内的元素
      

  5.   

    上面的forms用你的form name代替