• Resolved moni

    (@muneeba)


    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’);

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter moni

    (@muneeba)

    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’);

    Plugin Author Takayuki Miyoshi

    (@takayukister)

    I suppose this question is about CFDB plugin, not about Contact Form 7, so I suggest posting it to their support forum instead of here.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Generate ID on the base of field values’ is closed to new replies.