How to use frm-condition to set a default value in a form field?

By: Jane Onorati | Asked: 10/24/2021
ForumsCategory: How-toHow to use frm-condition to set a default value in a form field?
Jane Onorati asked 3 years ago
This does not do everything I need, but I think it should work but does not:
[frm-condition source=frm-math content="[2874] - [2873]" less_than=0]"0"[/frm-condition]
2874 & 2873 are two number fields and the frm-condition shortcode is in another number field on the same form.  If I enter 2 numbers whose difference would be less than zero, nothing happens.  The field with the frm-condition shortcode is blank.  I have never been able to get this particular shortcode to work in any forms. -Jane
Jane Onorati replied 3 years ago

It seems the code format thing does not work. This is the code that should be in the grey box above:
[frm-condition source=frm-math content="[2874] - [2873]" less_than=0]"0"[/frm-condition]

1 Answers
Chris AdamsChris Adams answered 3 years ago
Hi Jane The frm-condition shortcode only works in a view as far as i know so i don't think it will work in a form. If you need to have a conditional calculation in a form you can use something like this:
([15] > 500) ? ([15] * .02) : (10)
You can read more about it HERE.

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