我用innerHTML给表格添加了行,但是添加完以后用document.form1.product_id.value方法娶不到值啊是这样添加行的:
newTd0.innerHTML = '<input type="text" name="product_id" readonly value="6" />';

解决方案 »

  1.   


    var product = document.createElement("input");
    product.setAttribute("name","product_id");
    .....
    newTd0.appendChild(product);那就这样吧 。
      

  2.   

    改下:
    newTd0.innerHTML = '<input type="text" id="product_id" name="product_name" readonly value="6" />';
    使用标准语法document.getElementById('product_id').value来获得
      

  3.   

    document.form1.product_id.value
    换成document.all("product_id").value也可以取值。