Many times I have read about a donate button. U know those button where D users can donate small amount 2 D site. But finding 1 is really tough. Paypal™ has a donate button, but U can donate only if U have a Paypal™ account. But everyone doesn't has a Paypal™ account.
So D other option is 2 allow people 2 use their credit-cards 2 donate. But 2 enable this feature U have 2 pay an excess of 20-25%. Now that is a real ripoff.
Another option is Alertpay™, they allow credit-card transaction 4 free after a simple site verification. But D problem is they don't have a ready made donate button. So D option is 2 use a buy button as a donate button.
But now D problem is that D amount 4 a buy button is fixed (as U don't want D user 2 decide D amount 4 a purchase), but in case of a donation D user wishes 2 select D amount 2 donate.
Now I searched D net 4 sometime & finally found a code which allows D user 2 change D amount 2 donate as per their wish. But it had some problem, just a glitch as U can add any text in D text box. Now that is silly as no one would enter alphabet in that text box but Y take D risk so I found a script & modified D code so that only positive integers can B entered in D text box.
So here is D code:
<html><head>
<!-- Code written by someone else but the whole thing is made by Tanmay Das -->
<script language="JavaScript">
function checkIt(evt) {
evt = (evt) ? evt : window.event
var charCode = (evt.which) ? evt.which : evt.keyCode
if (charCode > 31 && (charCode < 48 || charCode > 57)) {
status = "This field accepts numbers only."
return false
}
status = ""
return true
}
</script></head><body>
Enter Donation Amount:
<form method="post" action="https://www.alertpay.com/PayProcess.aspx">
<input type="hidden" name="ap_purchasetype" value="item-goods">
<input type="hidden" name="ap_merchant" value="yourmail@yourdomain.com">
<input type="hidden" name="ap_itemname" value="Donate">
<input type="hidden" name="ap_returnurl" value="">
<input type="hidden" name="ap_quantity" value="1">
<input type="hidden" name="ap_description" value="Description of your donation">
<input type="text" name="ap_amount" value="" onKeyPress="return checkIt(event)">
<select name="ap_currency">
<option value="AUD">AUD</option>
<option value="BGN">BGN</option>
<option value="CAD">CAD</option>
<option value="CHF">CHF</option>
<option value="CZK">CZK</option>
<option value="DKK">DKK</option>
<option value="EEK">EEK</option>
<option value="EUR">EUR</option>
<option value="GBP">GBP</option>
<option value="HKD">HKD</option>
<option value="HUF">HUF</option>
<option value="LTL">LTL</option>
<option value="MYR">MYR</option>
<option value="NOK">NOK</option>
<option value="NZD">NZD</option>
<option value="PLN">PLN</option>
<option value="RON">RON</option>
<option value="SEK">SEK</option>
<option value="SGD">SGD</option>
<option value="USD" selected="selected">USD</option>
<option value="ZAR">ZAR</option>
</select>
<input type="hidden" name="ap_cancelurl" value="">
<input type="image" name="ap_image" src="donate.gif">
</form>
</body>
</html>
Doo tell me if U find it handy