1

I have created a form using webform in Drupal 6. I have set a action URL like node/15 a new node. When form is submitted it will be redirect this node. I want to display all values which are filled by user at this page. Please help.

Thank you

1 Answer 1

0

You can use hook_form_alter and add your custom submit handler.


    /**
     * Implements hook_form().
     */
    function hook_form_alter(&$form, $form_state, $form_id) {
        if ($form_id == 'WEBFORM_ID') {
            $form['#submit'][] = 'custom_webfrom_submit';
        }
    }

    /**
     * Implements webform custom handler
     */
    function custom_webfrom_submit($form, &$form_state){
        //get the values here $form_state['values']
    }
6
  • Thank you very much for your reply. can you please tell me where i will use this code . i am redirecting my from at node/6 after submission
    – Developer
    Commented May 27, 2014 at 11:43
  • Use in your custom module. Tutorial for custom module development
    – Inizio
    Commented May 27, 2014 at 11:50
  • By the way thanks for your reply. i was asking for any solution in the node page using admin and i got the solution. enable php filter module . edit the page where form is redirecting after submission and add <?php module_load_include('inc','webform','includes/webform.submissions'); $sid = $_REQUEST['sid']; $submission = webform_get_submissions(array('sid' => $sid)); $nid = $submission[$sid]->nid; $web_submission = webform_get_submission($nid, $sid); $node = node_load($nid); print $output = webform_submission_render($node, $web_submission, NULL, 'html'); ?>
    – Developer
    Commented May 27, 2014 at 13:09
  • Adding PHP code in your database by enabling this PHP filter can cause you to get extremely unsafe sitewise. So my suggestion is to add in the custom module only.
    – Inizio
    Commented May 27, 2014 at 13:31
  • Okay. so custom_webfrom_submit function result will be displayed on the page which i will use as action page for this webform . am i right ?
    – Developer
    Commented May 27, 2014 at 13:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.