Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Javascript for perptually recurring donation. See the link for suggestions about CSS for the added disclaimer.
<script type="text/javascript">
$(document).ready(function () {
var term = $('select[name=TERM]');
var disclosure = 'Your recurring donation will be automatically deducted '
+ 'from your account on a monthly basis.';
term.parent()
.after('<input type="hidden" name="PAYPERIOD" value="MONT"/>')
.after('<input type="hidden" name="TERM" value="9999"/>')
.after('<div class="perpetual-disclaimer">' + disclosure + '</div>')
.remove();
$('select[name=PAYPERIOD]').parent().remove();
$('#recurring_options').html($('#recurring_options').html().replace('times', ''));
$('.link-help').hide()
$('#recurring').click()
// If you would like to have the donation page be only for the monthly amount
// and not have an option for a one-time amount, then remove '//' from the next line.
//$('input[name=recurring]').parent().hide()
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.