What I want to accomplish is to have user enter an amount into text input on website, and when the paypal donate button is clicked, the payment form is pre-populated with the amount that they entered into the text input.
I have seen other posts which have answers that seem to have solved this problem in the past, but while trying to implement the same solution myself, I am unable to get it work... If this is do to a small ignorant oversight on my part, then I apologize in advance.
Here is the code snippet that I get from paypal when I choose a donate button type and select the option "Donors enter their own contribution amount"
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="XXXXXXXXXX">
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
Here is a post that has solved this issue for others: Paypal custom amount for "Donate Now" button
Following what that post has to say, I modified my paypal snippet thusly:
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="text" name="amount" id="amount" value"">
<input type="hidden" name="hosted_button_id" value="XXXXXXXXXXX">
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
So, I've just added <input type="text" name="amount" id="amount" value"">
, which from what I understand should have allowed me to pass the value of my input to the payment form. This isn't working for some reason.
Help would be very much appreciated!