PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

How to insert a new confirmation message via 'gform_pre_submission'

  1. I'm using gform_pre_submission to do some calculations on the values from my form after it's submitted. I want to display this result in my confirmation message. I tried replacing the form's confirmation message by assigning my result value to 'message' in the 'confirmation' array. But no luck!
    Any way I can achieve this?
    Note: I know about the gform_confirmation filter, but I don't know how to use it in my case.
    Here's what I tried:

    add_action('gform_pre_submission', 'my_processing');
    function my_processing($form){
        //add up the values
        $val = $val1+$val2....
    
        //what I tried
        $form['confirmation']['message'] = 'The answer is:- '.$val;
    }

    Please reply guys!

    Posted 7 years ago on Wednesday March 28, 2012 | Permalink