我有一個帶有8個收音機輸入按鈕的表格,我想根據用戶的收音機輸入選擇更新總價格。如何通過jQuery實現這一點?基於收音機輸入選擇更新總價
<table>
<tr>
<td></td>
<form name="m" action="" method="post">
<th> <input id="test" name="purchaseChoice" class="radio" onclick="togglePrices(false);" type="radio" value="P2"/>
<label for="purchaseChoice">£5</span> </label>
<input id="test" name="purchaseChoice" class="radio" onclick="togglePrices(true);" type="radio" value="P1"/>
<label for="purchaseChoice">£10</label>
</th>
<th class=""> <input id="test" name="purchaseChoice" class="radio" onclick="togglePrices(true);" type="radio" value="S111"/>
<label for="purchaseChoice">£20</label>
<input id="test" name="purchaseChoice" class="radio" onclick="togglePrices(false);" type="radio" value="S112"/>
<label for="purchaseChoice">£30</label>
</th>
<th class=""> <input id="test" name="purchaseChoice" class="radio" onclick="togglePrices(true);" type="radio" value="S131"/>
<label for="purchaseChoice">£40</label>
<input id="test" name="purchaseChoice" class="radio" onclick="togglePrices(false);" type="radio" value="S132"/>
<label for="purchaseChoice">£50</label>
</th>
<th class="highlight"> <input id="test" name="purchaseChoice" class="radio" onclick="togglePrices(true);" type="radio" value="S121"/>
<label for="purchaseChoice">£60</label>
<input id="test" name="purchaseChoice" class="radio" onclick="togglePrices(false);" type="radio" value="S122"/>
<label for="purchaseChoice">£70</label>
</th>
</form>
</tr>
<tr>
<th class="total">TOTAL YOU PAY</th>
<th>
<div class="Priceband"></div>
</th>
</tr>
</table>
感謝
您的價格值在哪裏? – 2012-02-20 11:36:59
價格值出現在輸入字段末尾。基本上,正如你可以看到我有8個值:P1,P2,S112,S111,S121,S122,S131和S132 – gek 2012-02-20 11:54:47