Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Systeme de donation PayPal - For GetKirby-Themes.com
function getEventTarget(e) {
e = e || window.event;
return e.target || e.srcElement;
}
function removeClass (argument) {
for (var i = argument.length - 1; i >= 0; i--) {
argument[i].className = ""
}
}
function selectUSD(){
var options = document.getElementById("options")
removeClass(document.getElementsByTagName("li"))
var activeAmount = getEventTarget(event)
activeAmount.className = "active"
document.getElementsByName("amount")[0].value = activeAmount.innerHTML
}
<form name="_xclick" action="https://www.paypal.com/fr/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="contact@site.rocks">
<input type="hidden" name="item_name" value="Donate">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="amount" value="5">
<ul id="options">
<li onclick="selectUSD()" class="">1</li>
<li onclick="selectUSD()" class="active">5</li>
<li onclick="selectUSD()" class="">10</li>
<li onclick="selectUSD()" class="">20</li>
</ul>
<button type="submit" border="0" name="submit">Donate</button>
</form>
<?php echo js('assets/js/donate.js') ?>
@jonabaptistella

This comment has been minimized.

Copy link

@jonabaptistella jonabaptistella commented Oct 22, 2016

Hi, I tried to style it up today. Looks good and works perfect. I will add that and all the themes to the page hopefully this weekend. PS: It is 01:14 at night here... 😸
donate-paypal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment