-
-
Save jonabaptistella/7730f77f20304f6ae59d37b916c8c9d4 to your computer and use it in GitHub Desktop.
Systeme de donation PayPal - For GetKirby-Themes.com
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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') ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment