Code snippet help: Needing to conditionally populate a text field with a numeric range/text string

By: Brian Minor | Asked: 02/13/2024
ForumsCategory: Code SnippetsCode snippet help: Needing to conditionally populate a text field with a numeric range/text string
Brian Minor asked 10 months ago

Hello, I have a recurring scenario in one of my forms where I want a text field to be conditionally populated with a specific value depending on a condition being met. One of these values is a text string. Here are my field types with what I want to accomplish:

[2057]= The target text field which I want to conditionally populate

[457]= text field type, that performs a numeric math calculation within it (output is only integers)

[464]= text field type which creates a text string using a text "calculation". The result is what appears as a numeric range. (integers from two other fields with a hyphen between them)

[338]=number field which dictates whether condition is met. If [338] == 0, then I want [2057] to be populated with [457], and if it is not equal to 0 then I want [464] to be populated in [2057].

My understanding is that conditional calculations can only use integers. Is anyone willing to help me with a custom code snippet to accomplish this? Thank you so much!

1 Answers
Victor Font answered 10 months ago
Have you seen this: https://formidableforms.com/knowledgebase/conditionals/
Brian Minor replied 10 months ago

I have, but I thought this wasn't an option to use within the form itself? I would like to be able to have this occur in real time within the form. Sorry if I am misunderstanding how to use this feature though!

Victor Font replied 10 months ago

You need to do it with jQuery if you want real time.

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