Require a total greater than 0 or a required conditional logic shown field

I need a little help here. I’ve been looking through forum to see if the was a solution to my problem. Yet, I have still not found the answer. So, I have a donation form that I have preset nomination values and then I have an “Other” as part of my radio button field Which is a required field.

Then, I have a field for “Donation Amount” if the “Other” value is selected. I have set conditional logic to only show the field if the “Other” option is selected.

Now, Everything works fine. However, if a person enters “Other” and does not enter in a value in the “Donation Amount” field. the Total of the amount processed is $0.00.

I understand I cannot required the “Donation Amount” that is hidden by conditional logic to be required otherwise it will cause an error.

I need to either required the “Donation Amount” field to be populated or a way that will not allow the form to be processed if the total is equal to $0.00.

Hopefully someone can help me.

Thanks

1 Like

Hi @cyber44 - if you are a Gravity Perks member, they have a solution for this:

They also have a free approach which works a little differently but may work for you:

I will leave this open in case anyone else has another solution they can recommend. Thank you.

1 Like

What if your “other” option was a radio field and then a range slider appeared if other is selected.

You can then force a number to be used with the range slider.

Then add a hidden number field which will allow you to calculate the form total with an equation.

Lastly, add conditional logic to the submit button so it only appears if the total is not 0.

Thank you for your suggestion, however I am not a Gravity Perks member.

Derek,
Thank you for your suggestion. the “other” is already a radio button selection. I have been looking at different options and I did come across possibly using the hidden field although. I’m trying to figure out how to implement it. Also, I had thought about the conditional logic on the submit button. still not 100% sold on doing that.

Thank you guys for you help. I’ll still not sure on what’s the best solution.

It sounds like a small snippet case where either gform_validation or gform_field_validation is appropriate. Checking the value of your ‘other’ ratio button field to then determine whether the extra numeric field should/not be considered accepted.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.