Submitted data not returning data from conditional fields
-
I have my form set up like this:
[select* topic include_blank "Test1|[email protected]" "Test2|[email protected]" "Test3|[email protected]"]
[group group_topic_test1 clear_on_hide]
[select* topic_test1 include_blank "AMG" "PRG" "KGL"]
[/group]
[group group_topic_test2 clear_on_hide]
[select* topic_test2 include_blank "ORG" "COB" "MNM"]
[/group]
[group group_topic_test3 clear_on_hide]
[select* topic_test3 include_blank "IRS" "LOM" "NJH"]
[/group]When the first topic is selected, I get the first group of dropdown displayed and so on. This is all working fine.
However in the functions.php file, the submitted data
$data = $submission->get_posted_data()
is not returning the data from the group fields:function action_wpcf7_before_send_mail_test( $contact_form ) {
$form_id = $contact_form->id();
if ($form_id == "234") {
$submission = WPCF7_Submission::get_instance();
if ($submission) {
$data = $submission->get_posted_data();
}
}
.........
.........
.........
.........
}It returns the selected ‘topic’ but not the group data:
$data: Array
(
[topic_test1] => Array
(
[0] =>
)
[topic_test2] => Array
(
[0] => Test2
)
[topic_test3] => Array
(
[0] =>
)
)Am I missing something?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- You must be logged in to reply to this topic.