This my code:
$('#paying_by').click(function()
{
if ($(this).val() == "GBPTRF")
{
$('.currency').html('£ ');
$('#c_card_rate').val("0.00");
$('#c_card_amount').val("0.00");
$('.total_inc_charges').val(); /*???? refresh? this is the question*/
$('.c_card_field').hide();
}
if ($(this).val() == "GBPCCARD")
{
$('.currency').html('£ ');
$('.c_card_field').show();
}
});
By default the c_card_field is hidden. If the user clicks on GBPCCARD then 2 fields appear within the c_card_field. One of them is the c_card_rate which is a %. Then the total amount increses with amount_due*c_card_rate/100. If the user selects GBPTRF again then, the c_card_field disappears. Of course I clear the the c_card_rate field but the total amount which has been increased by the c_card_amount(amount_due*c_card_rate/100) remains increased until I amend the amoun_due field.
Question: How can I refresh the total_inc_charges when the user clicks GBPTRF again?
Thank you.
total_inc_charges?