Default Values on Conditional logic

By: Darrel Allam | Asked: 10/05/2023
ForumsCategory: General questionsDefault Values on Conditional logic
Darrel Allam asked 6 months ago
Hi, we have created a form with numerous embed forms. We are having the following issue: We have hidden embedded forms with conditional logic. Some of the forms have default values particularly on products. These default values seem to pass through even though the embedded form is conditionally hidden. I was under the impression that if something was hidden conditionally no values  would pass through unless the conditions were met?   Many thanks for any help. :) 
Rob LeVineRob LeVine replied 6 months ago

I think I understand, however, I will ask that you clarify "pass through" and also give a specific example of what you're doing.

Darrel Allam replied 6 months ago

Hi Rob

Thanks for your reply. I will try to explain. For example if I have 2 products one hidden by conditional logic and one showing. The one hidden is set to a default value. I would expect only the amount from the one showing to go through to the total. However the product that is not showing because conditions have not been met is still adding to the total cost. If I do not have a default value on the hidden product it is fine. However I require default values as it makes it easier for our customer.

Many Thanks

Rob LeVineRob LeVine replied 6 months ago

I'm about halfway there. I am looking more for a "technical" explanation of how you embed a form and use a value from it as part of a calculation. I created a form with an A/B dropdown, some number fields and a total field. Based on selecting A or B, the number fields show/hide conditionally. The total field works as expected, only totaling the fields that are shown. So the next step was to create a form with a number field and embed that form into the original form and make that embedded form's number field be part of the total. I did that and made the embedded form conditional on the A/B dropdown, included its value in the Total calculation and it works as expected as well. So, what are you doing differently?

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