Based on Manipulating Form Data Before it is Saved,
Assuming the values submitted in your checkboxes are the form names, I think this would work:
require_once(ABSPATH . 'wp-content/plugins/contact-form-7-to-database-extension/CF7DBPlugin.php');
function save_to_multiple_forms($formData) {
$formName = 'your-form'; // change this to your form's name
$fieldName = 'form-names-field'; // change this to your form's name
if ($formData && $formName == $formData->title) {
if (isset($formData->posted_data[$fieldName]) && is_array($formData->posted_data[$fieldName])) {
$plugin = new CF7DBPlugin();
$num_selections = count($formData->posted_data[$fieldName]);
for ($idx = 0; $idx < $num_selections; ++$idx) {
$formData->title = $formData->posted_data[$fieldName];
if ($idx < ($num_selections - 1)) {
$plugin->saveFormData($formData);
}
}
}
}
return $formData;
}
add_filter('cfdb_form_data', 'save_to_multiple_forms');
Thank you Michael!
I have tried with this code but I think I made some mistake.
Contactform: Nordcup_2017
[checkbox* checkbox-839 “Verein 1” “Verein 2” “Verein 3” “Verein 4” “Verein 5” “Verein 6” “Verein 7”]
` $formName = ‘Nordcup_2017’; // change this to your form’s name
$fieldName = ‘checkbox-839’; // change this to your form’s name
Now when i trie this it creates always a DB which has no name and is empty.
I think it’s a similar mistake from me.
MANY THANKS!!!!
My code suggestion might not be quite right. You may have to play around with it.