dreamclutch
Programmer
Below is the parsed php information from my code. I somehow need to use javascript to pull two price fields from my db and use of a toggle radio button for each existing product row in cart. I can pull the two price fields from my db fine, but how would I integrate that into javascript so that when a user selects a distinct row's radio button field, it changes the associated price value and reflects altered total price for total items in cart?
function viewPrice(){
//Assuming I'd have to use document.getElementsByTagName('input')? to retrive number of rows and associated values?
}
<form action='/cart.php' method=POST name=main_form>
<a name="cart">
<table width="100%" border="0" cellspacing="4" cellpadding="10"><tr bgcolor="#D9E9C9"><td width="73%" class="body1"><strong>Your Templates</strong></td>
<td class="body1"width="15%"><strong>Remove</strong></td>
<td class="body1" width="12%"><strong>Total</strong></td></tr><tr bgcolor="#E9F2DB"><td class="body1">Starry Eyed Suprise</td><td class="body1"><a href='catalog.php?remove=57'><b>Delete</b></a></td>
<td class="body1">75.00</td></tr><tr bgcolor="#E9F2DB"><td class="body1">Golfing in Nature</td><td class="body1"><a href='catalog.php?remove=78'><b>Delete</b></a></td>
<td class="body1">75.00</td></tr><tr bgcolor="#F2F7EA"><td class="body1"> </td><td class="body1"><div align="right">Subtotal:</div></td>
<td class="body1">$150</td>
</form>
</tr>
<tr bgcolor="#F2F7EA">
<td height="39" class="body1"> </td>
<td class="body1"><div align="right">Total:</div></td>
<td class="body1">$150</td>
</tr></table><form name="_xclick" action=" method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="item_name" value="">
<input type="hidden" name="item_number" value="1">
<input type="hidden" name="notify_url" value="">
<input type="hidden" name="return" value="">
<input type="hidden" name="cancel_return" value="">
<input type="hidden" name="cn" value="">
<input type="hidden" name="amount" value="150">
<input type="image" src="images/checkout.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
</form>
</td></tr></center></center></table>
function viewPrice(){
//Assuming I'd have to use document.getElementsByTagName('input')? to retrive number of rows and associated values?
}
<form action='/cart.php' method=POST name=main_form>
<a name="cart">
<table width="100%" border="0" cellspacing="4" cellpadding="10"><tr bgcolor="#D9E9C9"><td width="73%" class="body1"><strong>Your Templates</strong></td>
<td class="body1"width="15%"><strong>Remove</strong></td>
<td class="body1" width="12%"><strong>Total</strong></td></tr><tr bgcolor="#E9F2DB"><td class="body1">Starry Eyed Suprise</td><td class="body1"><a href='catalog.php?remove=57'><b>Delete</b></a></td>
<td class="body1">75.00</td></tr><tr bgcolor="#E9F2DB"><td class="body1">Golfing in Nature</td><td class="body1"><a href='catalog.php?remove=78'><b>Delete</b></a></td>
<td class="body1">75.00</td></tr><tr bgcolor="#F2F7EA"><td class="body1"> </td><td class="body1"><div align="right">Subtotal:</div></td>
<td class="body1">$150</td>
</form>
</tr>
<tr bgcolor="#F2F7EA">
<td height="39" class="body1"> </td>
<td class="body1"><div align="right">Total:</div></td>
<td class="body1">$150</td>
</tr></table><form name="_xclick" action=" method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="item_name" value="">
<input type="hidden" name="item_number" value="1">
<input type="hidden" name="notify_url" value="">
<input type="hidden" name="return" value="">
<input type="hidden" name="cancel_return" value="">
<input type="hidden" name="cn" value="">
<input type="hidden" name="amount" value="150">
<input type="image" src="images/checkout.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
</form>
</td></tr></center></center></table>