0
我有一個PHP的大表格,有幾個表格,每個表格計算一個總和(價格和數量),然後有一個在最後計算總數。
的結構,或多或少,這樣的:重新提交表單以提交後錨定
<form action="" id="purchase_form">
<div id="purchase_1">
<table>
<input id="price_1">
<input id="quantity_1">
<input type="submit" name="calculate" value="Click here to calculate the partial">
</table>
</div>
<div id="purchase_2">
<table>
<input id="price_2">
<input id="quantity_2">
<input type="submit" name="calculate" value="Click here to calculate the partial">
</table>
</div>
<tr>
<td id="price_sum"><?php *script* ?></td>
<td id="quantity_sum"><?php *script* ?></td>
</tr>
</form>
現在,當我點擊提交計算「部分」,它給我的總的,在同一時間。我知道這不是最新的形式,但無論如何,只是試圖對此視而不見。
我想要的是,當我點擊提交按鈕時,讓頁面重新載入顯示我點擊的窗體。就像,如果我點擊#purchase_1表格的提交,我希望頁面重新加載在#purchase_1表格中,依此類推。
是否有可能通過javascript來做到這一點?