1

Im looking for a way to add a minimum amount for a paypal donation (which is 1 euro). I tried many different things but i cant figure out how i am supposed to do this.

Tried a dropdown menu like:

PayPal Donation Button: Adding 'Amount' and 'Currency'

Second post there (converting a buy now to donation button) But when i click on it, it goes to the page i get this:

Please enter your donation amount and click Update Total.

So now i was wondering if anybody was able to help me. I dont mind if its javascript/php based or something as long as the minimum is 1 euro. It needs to work for a Premiun account (because its not a business account).

Thank you in advance for any help provided.

Fixed it myself:

Manage to sort it out myself:

In the

<script type="text/javascript">
<!--
function validate_form ( )
{
valid = true;
if ( document.donation_form.amount.value < 1 )
{
alert ( "Please enter a minimum of 1.00 EUR" );
valid = false;
}
return valid;
}
//-->
</script>
Community
  • 1
  • 1
Anori
  • 73
  • 2
  • 10

1 Answers1

1

Manage to sort it out myself:

In the

    <head>

    <script type="text/javascript">
    <!--
    function validate_form ( )
    {
    valid = true;
    if ( document.donation_form.amount.value < 1 )
    {
    alert ( "Please enter a minimum of 1.00 EUR" );
    valid = false;
    }
    return valid;
    }
    //-->
    </script>

Now its quite simple. The if( document.donation_form.amount.value <1) simply checks if the value inside the box is 1.00 or higher. Its the code Paypal provides more or less. They use a <form ...="donation_form"> Then the text input text field is called <input name="amount">

Anori
  • 73
  • 2
  • 10