PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Remove validation for negative price

  1. royalston
    Member

    Hello,

    I've seen a similar post to this, but the solution still wasn't quite what I'm needing. I am using Gravity Forms for a camp registration payment front-end.

    Some campers receive scholarships of varying amounts. A coupon system wouldn't be efficient, since there are nearly an infinite number of scholarship amounts that could be awarded. What I was hoping for is a "product" field (i.e. scholarship field) that allows a negative number. I've tried that solution, and Gravity Forms accepts the negative amount and adjusts the final total correctly. However, when the user submits to pay, the script returns an error. Is there any way whereby that field's validation routine (i.e. the scholarship field) could allow for negative values? The test page is located:

    http://mountpalomarbiblecamp.org/test/

    Thanks,
    Roy

    Posted 12 years ago on Monday January 16, 2012 | Permalink
  2. Hi Roy,

    Gravity Forms doesn't have any problem with the negative values, it's PayPal where the issue lies. When Gravity Forms sends the order to PayPal it doesn't just send the total, it sends over each product separately. The problem is that PayPal does not accept negative values for product prices. You would need to use the gform_paypal_query hook to search for negative values in that string and send them as coupon values instead.

    Posted 12 years ago on Monday January 16, 2012 | Permalink
  3. David, I have the same issue. I want my clients to suggest a discount as a product in the user defined pricing field. It calculates fine when negative amounts are input, but when "Submit" is clicked, an error message pops up because only positive numbers are allowed. I am not good at CSS, but perhaps there is a CSS that will allow for negative numbers in the product field. Is there a solution that can be recommended?

    My form is on http://www.erosconsulting.ca/services/project-estimates/

    Posted 11 years ago on Friday November 16, 2012 | Permalink
  4. Royalston, how did you get your discount to work in your total?

    Posted 11 years ago on Friday November 16, 2012 | Permalink
  5. @chaderos, I just tried your form with a 500 discount, and I was able to submit with a total of $-460. I saw this after submission:

    Thank you for your choosing Eros Consulting. We will be in contact with you shortly to discuss your project with you.

    Have you modified your form since posting your request here?

    Posted 11 years ago on Saturday November 17, 2012 | Permalink