我有一些数据库的结果,我在表格填充他们,我有这样的代码:我想要更新的特定文本框的值
<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
您可以在那里给出示例数据。 –