Hello
If you go to this page https://www.barnardos.org.uk/donate/...ingle+Donation
and enter a donation amount and then click on the yes box you will see the percentage of the gift aid is worked out.
Can anyone help with a JS way to do this please?
Hello
If you go to this page https://www.barnardos.org.uk/donate/...ingle+Donation
and enter a donation amount and then click on the yes box you will see the percentage of the gift aid is worked out.
Can anyone help with a JS way to do this please?
Code:document.getElementById('giftAid_IncomeAgreement').onclick = function(){ //the checkbox if(this.checked){ var base = document.getElementById('don_amount').value, //the input with the amount's value added = base * 0.25, total = +base + added; total = total.toFixed(2); //pad/crop to 2 decimal places document.getElementById('giftAidMessage').innerHTML = 'Total amount with Gift Aid £' + total; //a span after the input } else { document.getElementById('giftAidMessage').innerHTML = ''; //that same span } }
Last edited by jscheuer1; 08-23-2013 at 05:04 PM. Reason: improvements
- John________________________
Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate
Thanks this works now, solved
Bookmarks