conditional syntax for a form field calculated default value

By: David Schellenberg | Asked: 09/29/2024
ForumsCategory: Code Helpconditional syntax for a form field calculated default value
David Schellenberg asked 3 weeks ago

I would like  a read-only field to calc a concatinated value based on a mix of text and numeric field entries I see numeric examples on youTube using syntax like;

([19] < 50) ? ([19]+[24]) : [19]

But can i write conditional default value for a field that considers a mix of text and numeric fields and what would the syntax look like for something like:

if field 20 = 'foo' then 'bar' else 'fighters'
1 Answers
Rob LeVineRob LeVine answered 3 weeks ago
Try ([20] == "foo") ? 'bar' : 'fighters'. I can't say that it'll work but it's the correct syntax.

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