Issues using shortcodes in default values.

By: Joshua Hebbel | Asked: 02/03/2025
ForumsCategory: General questionsIssues using shortcodes in default values.
Joshua Hebbel asked 2 weeks ago

I am having 2 shortcode issues;

Issue 1
I am trying to merge a text field that has the entered name and address field but the address is not showing up
where 44 is the name and 45 is the address field(s)
[44] - [45]
this only returns "John Doe -"
no address

Issue 2
Trying to show a field value only if a radio button has a certain option ticked
[28][if 28 equals="Window"] - [29][/if 28][if 28 equals="Door"] - [30][/if 28]
the shortcodes logic is not being evaulated the only shortcodes working are the non logic ones.

Bobby Clapp Staff replied 2 weeks ago

For issue 2, is this being evaluated on a live form or in a view where entries have been populated?

Joshua Hebbel replied 2 weeks ago

@Bobby Clapp its in the default value field for a textbox

Bobby Clapp Staff replied 2 weeks ago

To me that sounds like the conditional values are attempted at being evaluated live then based on the radio in the same form. You're going to have to introduce some javascript here I think. The field values in the same form cannot be evaluated via the conditional shortcode until they have been saved. You'll need some javascript to perform the "live" conditional checks. A more "conditional" version of this:

https://formidableforms.com/knowledgebase/javascript-examples/#kb-get-option-label-from-radio-button

When the radio value "changes", do something and populate other field values.

Joshua Hebbel replied 2 weeks ago

Why is this not needed when evaluating math conditions? How does adding two fields together work if it is server executed code?

Bobby Clapp Staff replied 2 weeks ago

I don't know the code that deeply. Maybe calculations have a pre and post javascript execution.

1 Answers
Victor Font Staff answered 2 weeks ago

The first issue I see is that you are not concatenating the fields. The proper way to concatenate two fields with a dash between them is [44]+"-"+[45]

Joshua Hebbel replied 2 weeks ago

It works as I posted when using a field other than address

Bobby Clapp Staff replied 2 weeks ago

What happens if you use a parameter specifically? [x show="line1"]

https://formidableforms.com/knowledgebase/address/#kb-display-address-fields

Victor Font Staff replied 2 weeks ago

Address fields are examples of embedded forms. They are not "fields"

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