Click to See Complete Forum and Search --> : Paypal donations and minimum value


Joe Siegler
11-04-2003, 12:34 PM
Hello. I'm a bit of a n00b when it comes to writing Javascript, so please excuse what may be some obvious dumbass questions. :)

I was working with Paypal's donations feature, and it seems to work well, except that you cannot set a minimum donation. In other words, I want to have three donation points for my donation. $35, $50, or more than $50. I have three seperate buttons for that, the third leaving the amount field empty so that folks can put in what they want.

Problem is there is nothing to stop them from putting in $2 as their donation, so what I'm looking for is a Javascript that will allow me to have the text entry box on my end, have them enter a value, and then if it's OK, pass it to the Paypal donations area through a form. If it's an invalid number, they won't be passed off. Anyone have any ideas? Below is the code for the form, I'd basically need to insert the value in this line of the form.

<input type="hidden" name="amount" value="35.00">

The form I'm using:

<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="myemail@here.com">
<input type="hidden" name="item_name" value="Donation Description">
<input type="hidden" name="amount" value="35.00">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="tax" value="0">
<input type="image" src="https://www.paypal.com/images/x-click-but04.gif" border="0" name="submit0" alt="Make payments with PayPal - it's fast, free and secure!" align="absmiddle" width="62" height="31"></form>

AdamBrill
11-04-2003, 12:52 PM
Yes, that would be possible, but I'm wondering why you wouldn't want to accept $2?? $2 is better than nothing, right? ;)

Basically, what you would want to do is create a form validation function that would check if the donation is more than $50. Something like this:

if(parseFloat(document.formname.amount.value)<50){
alert("Please enter more than $50 in this box.");
return false;
}
return true;

If you can't figure out how to use that, let me know...

charityweb
03-12-2012, 07:46 PM
Thanks for the possible solution but I do want to point something out. Donations under $10 really do hurt charities. We have to process those donations, Paypal takes a cut, and then no one wants any portion of their donations to go to administration or fundraising.

My charity gets this all the time with paypal. We get one $50 donation a day, which demands our account run an entire process alongside the database administrator. Then someone donates $3.21 and asks that it be restricted to [insert your favorite country here]. Nonprofit fundraising offices barely scrape by and depend largely on interns as support staff. Many donors have no idea how badly small and/or infrequent donations can hurt the fundraising capabilities of charities, especially small charities.