-1
阵列我有这样的功能:检索在输入字段
function AddRowToForm(row){
$("#orderedProductsTblBody tr").each(function(){
// find the first td in the row
arr.push($(this).find("td:first").text());
});
for (i=0;i<arr.length;i++)
// display the value in input field
document.getElementById("message").innerHTML = (arr[i] + "<br >");
});
}
的问题是,我要检索的输入字段中的数组转换成一种形式。输入字段是最后一个(id =“message”)
fieldset class="pure-group">
<label for="date">Data: </label>
<input id="date" name="date" type="text"/>
</fieldset>
<fieldset class="pure-group">
<label for="time">Ora: </label>
<input id="time" name="time" />
</fieldset>
<fieldset class="pure-group">
<label for="pax">Numero di Persone: </label>
<input id="pax" name="pax" />
</fieldset>
<fieldset class="pure-group">
<label for="message">Esperienze: </label>
<input id="message" name="message" rows="5"></input>
</fieldset>
问题是该函数不起作用。我尝试过使用document.write(而不是innerHTML,它可以工作,但是它取消了所有的事情,任何帮助?提前谢谢你!:
所以你想要的输出是什么?输入没有innerHTML,输入的行是? – epascarello
T ry用'value'替换'innerHTML',因为'message'是一个输入。 – Santi
@epascarello我想要表的第一列的文本值 –