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>
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>