Default Value Lost on Conditionally Display Checkbox in Multipage Form

I have some complex validation logic that I implement manually in gform_post_paging. On the last page we have Terms and an Opt-In checkbox that the client requires be automatically checked.

The checkbox is checked by default when the field has no Conditional Logic. No sweat there.

The issue seems to be when CL is dependent on a Hidden Field that I attempt to set manually using

$_POST[‘input_43’] = 1;

The checkbox is no longer checked by default.

Am I going about this the right way? I think I need to be able to programmatically tell the following page whether or not to show the fields by setting a hidden field value they’re dependent on.

Thanks!

-Bill

Can you share the full code you are using to populate the field?

Sure, though the client requirements run wild and I’m in no position to push back. It’s somewhat extensive so I’ll try to summarize.

The form collects data including emails from 2 parties. My code determines whether they exist in our custom post types and I need to determine email fields have been populated new or existed already. Finally, a form should not be submitted without all required fields. I run validation logic manually and trying to get conditional logic to work in all cases. I can either get conditional logic working OR the default checkbox value, but not both. I think the pattern is if a dependent field is hidden, the default is blown away.

Logic is in the switch statement for page 5.

.php file linked below, I try to set a conditional field on line 490

$_POST[‘input_55’] = rgpost( ‘input_71’ );
https://drive.google.com/file/d/1CfbJOw_Gh3FMx2dWWD-v4mnPAQ-zqls-/view?usp=sharing

© 2008 - 2019. Gravity Forms is a project by Rocketgenius Inc.