Min set for donations

  • Profile Image
    maxboost
    Asked on March 29, 2012 at 09:00 PM

    For donations setting, is their a way to set a min set price and cant got below it?

  • Profile Image
    idarktech
    Answered on March 29, 2012 at 11:37 PM

    Hi there,

    Yes, but you need to use your form's full source code in order to achieved that. After downloading your form source code, open the .html file and try to apply this js code just above the </body> tag.

     

    <script type="text/javascript">

      document.getElementById('input_18_donation').onchange = function(){

          if(this.value < 25){

    alert("Please enter more than $25 in this box. Thanks");

    return false;

          }

    }

    </script>

    Result: http://idarktech.com/jotform/limit_donation.html

    Hope this helps. Thanks.

  • Profile Image
    liyam
    Answered on March 29, 2012 at 11:50 PM

    Here's an alternative solution, maxboost.  You can use idarktech's suggestion on getting the source code but use this script instead.

    Insert this javascript code within your head tag:

    <script>
    function checkForInvalid(obj) {
         var x=document.forms["form_20535705821146"]["q18_donationpaypal[price]"].value;
         if (x < 25)
           {
           alert("Please set amount to at least 25");
           return false;
           }
    }
    </script>

    Then, in your form tag, add this attribute:

    onsubmit="return checkForInvalid(this)"

    So it will look something like this: <form class="jotform-form" action="http://submit.jotform.us/submit/20535705821146/" method="post" name="form_20535705821146" id="20535705821146" accept-charset="utf-8" onsubmit="return checkForInvalid(this)">

    You can test the form in action from this link:

  • Profile Image
    maxboost
    Answered on April 24, 2012 at 07:44 PM

    first one works, unitl they place a " 0 ", i'll try the 2nd tomorrow