samedi 22 juin 2019

add number value from radio checked to span, then add/remove number value from separate checkbox

i have a number of quantities that are available to select by radio, and i want the price of that to show up in the TotalPrice span. however i also have another checkbox below the quantities for a shipping option that i would like added onto the TotalPrice span on top of the quantity price.

<th scope="row">
<input class="form-check-input" type="radio" name="quantity" id="quantity1" value="1">1</th>
<td>FREE + $6.97 S&H</td>
</tr>
<tr style="text-align: center;">
<th scope="row">
<input class="form-check-input" type="radio" name="quantity" id="quantity2" value="2">2</th>
<td>FREE + $9.97 S&H</td>
</tr>
<tr style="text-align: center;">
<th scope="row">
<input class="form-check-input" type="radio" name="quantity" id="quantity4" value="4">4</th>
<td>FREE + $16.97 S&H</td>
</tr>
<tr style="text-align: center;">
<th scope="row">
<input class="form-check-input" type="radio" name="quantity" id="quantity6" value="6">6</th>
<td>FREE + $21.97 S&H</td>
</tr>
<tr style="text-align: center;">
<th scope="row">
<input class="form-check-input" type="radio" name="quantity" id="quantity8" value="8">8</th>
<td>FREE + $26.97 S&H</td>

<input class="form-check-input" type="checkbox" name="ship" value="Expedited" id="exp1">

<span id="TotalPrice"></span>

also, is it possible for the values (quantity, expedited & TotalPrice) to be sent thru and picked up via $_POST in php?




Aucun commentaire:

Enregistrer un commentaire