我有一些數據庫的結果,我在表格填充他們,我有這樣的代碼:我想要更新的特定文本框的值
<input type='button' name='add' onclick='javascript: addQty();' value='+'/>
<span><?php echo $records['ct_qty']; ?></span>
<input type="text" class="gridder_input" name="quant[]" class="quant" id="quant[]" />
<input type='button' name='subtract' onclick='javascript: subtractQty();' value='-'/>
所以我想,當用戶按下「定量」按鈕更新特定行:
function addQty() {
document.getElementById("quant").value++;
}
function subtractQty() {
if (document.getElementById("quant").value - 1 < 0) {
return;
} else {
document.getElementById("quant").value--;
}
updateQuantity();
}
此代碼的工作時,我有一個排,當我有2個或更多的行沒有什麼工作,所以我可能不得不用這個詞什麼的?
你能在jsfiddle.net上設置演示嗎? –
我如何更新那裏的MySQL結果? – perastikos1
您可以在那裏給出示例數據。 –