Hi Sean,
Thank you for contacting us and I'll be happy to assist.
The conditional shortcode for forms ( [cred_show_group] ) is designed to work with the form field values and the validation function also can recognize whether a field should be ignored or not for validation when it is hidden based on a field's value.
In case the [cred_show_group] shortcode is using the values generated through other shortcodes or custom functions, you'll be able to hide the field, but validation will still show an error if that field is a required field.
To avoid this situation, I'll suggest the following steps:
1. Please add following code in your active theme's "functions.php" file, to register a new shortcode:
// check post's taxonomy
add_shortcode('check-parent-trip-tax', 'check_parent_trip_tax_fn');
function check_parent_trip_tax_fn() {
if (!empty($_GET['parent_trip_id'])) {
$value = do_shortcode('[wpv-post-taxonomy type="triptype" format="slug" id="'.$_GET['parent_trip_id'].'"]');
if($value) {
return $value;
}
}
}
The above code will register a new shortcode [check-parent-trip-tax], which gets the URL parameter "parent_trip_id" and returns the slug of the term attached to that post in "triptype" taxonomy.
2. Next, you can add the following code to register a new hidden generic field, which gets its value from our newly registered shortcode:
[cred_generic_field type='hidden' field='field-check']
{
"default":"[check-parent-trip-tax]"
}
[/cred_generic_field]
Note: this generic field code can be added in the form, just before the conditional field's block.
3. After that, you'll be able to use the value of this hidden field in your condition, like this:
[cred_show_group if="( $(field-check) eq 'day-trip' )"]
......
[/cred_show_group]
I hope this helps.
regards,
Waqar