How to make fields appear based on conditions of two other fields?

By: Stephanie Groom | Asked: 10/01/2021
ForumsCategory: How-toHow to make fields appear based on conditions of two other fields?
Stephanie Groom asked 3 years ago
I have two fields that calculate values, and I want a third field to pop up based on which value is higher. Is this a thing that's possible? 
1 Answers
Chris AdamsChris Adams answered 3 years ago
Hi Stephanie, Sure you can do this. The best way is probably using jQuery to write a script that compares the 2 values but you could also do it with a hidden field. Formidable allows conditional calculations as a default value so you could set a hidden field to compare the 2 calculated values and then do it's own comparrison. For example you could put this in your hidden field:
([10] > [11]) ? (1) : (0)
This would compare field 10 to field 11 and if the value of 11 is greater the value of the hidden field will be 1. if it's lower then the value will be 0. You can then use that as the basis of your conditional logic to show / hide your other field. Failing that then jQuery would be the way to go. I dont think there's an example in the FF KB that does exactly what you need but THIS is close and could be amended. Hope that helps. Chris

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community
crossarrow-right