Hi!

I have a form in Drupal that is filled up by an user and sent as email to the server. I have created a new module to modify the values in the form after the user submit it and to send them to the server with new values.

Here is my code:

function medilux_cm_form_alter (&$form, $form_state, $form_id) {
    if ($form_id == "webform_client_form_59") {
        $form['#submit'][] = 'medilux_custom_webform_submit';
    }
}

function medilux_custom_webform_submit($form, $form_state){
    foreach($form_state['values']['submitted'] as $key => $value){
        $form_state['values']['submitted'][$key] = 'new_value_' . $key;
    };
}

Please advise what is wrong in this code.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.