У меня есть таблица с 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>
Благодаря
Где ваши цены? –
Значения цен присутствуют во вводе, поданном в конце. В принципе, как вы можете видеть, у меня есть 8 значений: P1, P2, S112, S111, S121, S122, S131 и S132 – gek