problem with jquery for add cart button
- by jessy
hi i have a problem with displaying amount.i have the page called make payment in this page i made three radio buttons, if i click the button that amount must add with addcart like a product.
<form id='theForm'>
<input type="hidden" name="totalamount" id="totalamount" value="1" />
input type="radio" name="rmr" id="payment1" value="3" onclick="updatepayment(this.value)" /
input type="radio" name="rmr" id="payment2" value="5.5" onclick="updatepayment(this.value)"/
input type="radio" name="rmr" id="payment4" value="10" onclick="updatepayment(this.value)"/
div id="finalamount"
/div
i think that problem is my js script. if i click that button there is no response. how do i solve that problem
you guys can give me any idea
$(document).ready(function() {
$(".cart :radio[name='rmr']").add(".cart :radio[name='rmr']").each(function() {
$(this).click(function() {
$(".cart :radio[name='rmr']").add(".cart :radio[name='rmr']").each(function() {
$(this).attr("checked", false);
});
$(this).attr("checked", true);
});
});
})
function updatePayment(val) {
$("").html("updatePayment(" + val + ")").appendTo(document.body);
}
thanks.have a nice day