Generate ID on the base of field values
-
I am using contact form 7 and contact form data base plugin to see submitted contact form values.
what I am trying to do is when contact form submitted a key should auto generate on the bases of contact fields that are (Nationality+DOB+# of Children+# of adults).
How is this possible ?
I had tried this code and it is generating unique id when form submitted can I modify this code so it generate concatenated field values in unique id column. If yes what should code look like ?
function add_unique_id($formData) {
$formData->posted_data[‘uniqueid’] = uniqid();
return $formData;
}
add_filter(‘cfdb_form_data’, ‘add_unique_id’);I tried this code to get value but it is not working not capturing data from fields.
function add_unique_id($formData) {
$formData->posted_data[‘uniqueid’] = “{$form_data->posted_data[‘Nationality’]}{$form_data->posted_data[‘date-970’]}{$form_data->posted_data[‘ChildName’]}”;
return $formData;
}
add_filter(‘cfdb_form_data’, ‘add_unique_id’);[ No bumping please. ]
- The topic ‘Generate ID on the base of field values’ is closed to new replies.