How to validate due amount to end only in 0 or 5?

  • RHemery
    Asked on August 24, 2016 at 8:23 AM

    Hi there

    On my form: https://form.jotform.com/62283840016956 we are processing payments via PayPal.

    Is there a way to validate the vouchers £ field so it will only go through to the gateway if the sum ends in a 0 or 5?

    Thanks

    Rich

  • Kevin Support Team Lead
    Replied on August 24, 2016 at 9:43 AM

    You may try with this, adding a Form Calculation widget to your form and then adding this formula:

    How to validate due amount to end only in 0 or 5?  Image 1 Screenshot 40

    How to validate due amount to end only in 0 or 5?  Image 2 Screenshot 51

    Then when a number is entered it will give a result, you should validate that this number is not a decimal, if the quantity ends in 0 or 5 then the result of the calculation should be a non-decimal value, this will be achieved with conditions, this is the condition that you should use:

    How to validate due amount to end only in 0 or 5?  Image 3 Screenshot 62

    You should use the same condition and instead of showing a text like I'm doing you may show the payment field.

    Here is my cloned form of your where I did apply this: https://www.jotformpro.com/form/62363430552955 

    Hope this helps. 

  • RHemery
    Replied on August 24, 2016 at 9:59 AM

    This works OK but what I need is it to validate the 'I want...' field not the 'Number' field you've created... is this possible?

    I guess if it's not the 'Number' field could act as a confirmation field, a bit like when you have to input your email address twice when registering for something.

    I guess it's also possible to hide the 'Calculation' field?

    Thanks

  • Kevin Support Team Lead
    Replied on August 24, 2016 at 10:42 AM

    Yes, it can be the payment field, I used the other field only as a test, but I have removed it and I'm using the payment field and it works the same: 

    How to validate due amount to end only in 0 or 5?  Image 1 Screenshot 20

    You can also check my form again and you should notice the change: https://www.jotformpro.com/form/62363430552955