Execute page conditional statements on form load

By: Ronald Minerd | Asked: 11/23/2022
ForumsCategory: Code HelpExecute page conditional statements on form load
Ronald Minerd asked 2 years ago
I have conditional statements to hide some pages when a field in the form says "hide". However when the form loads, the pages show until the user hits "Next" button. I would like to hid the pages as the form loads. Any help would be appreciated.
Bobby Clapp replied 2 years ago

Would that be because the "hide" fields aren't on the first page or why do you think it is not working?

Ronald Minerd replied 2 years ago

Good question. Yes, conditionals for both fields and pages. I want use to skip some pages/fields that do not apply.

Bobby Clapp replied 2 years ago

Have you checked your developer console in the browser to check for javascript errors? This is the most common issue related to things like this.

Ronald Minerd replied 2 years ago

I don't see any errors. Also, on the first page, I have conditionals that work fine, But all of the pages show in the rootline until I hit Next button, then the rootline changes to show the few pages.
So, I guess it is the rootline/progress bar that is my problem--getting it to only show the conditional pages on form load.

Bobby Clapp replied 2 years ago

Could be a bug. Did you submit this with formidable support?

Ronald Minerd replied 2 years ago

I have submitted to formidable in past, but the answer was "that's how it works". So, I am looking for an alternate solution. Maybe a way in setup_vars hook to alter the rootline.

Bobby Clapp replied 2 years ago

I don't have a PHP solution for that. You might be able to have a document ready hook in jQuery to have it hidden when the page loads. Presuming that happens pretty quickly, the user might only see that option for a short second.

Ronald Minerd replied 2 years ago

<p>FYI from formidable support: "conditionally Hiding the rootline isn't currently built into Formidable Forms. I've made a note of your request so we can track and evaluate if this is an option that would benefit a high number of users."</p><p>So until then, anybody know a way to alter the rootline/progress bar?</p>

1 Answers
Victor Font answered 2 years ago
Root lines are list objects. ul/li. You can hide list items with jQuery.
Ronald Minerd replied 2 years ago

Thank you Victor, I will look into it. By the way, I appreciate the work you have done to augment the support for people using Formidable Forms.

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