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!