// http://www.gravityhelp.com/forums/topic/simple-calculations // change the 41 here to your form ID add_action('gform_pre_submission_41', 'ch_awesomeness_rating'); function ch_awesomeness_rating($form) { // set up one array for each step of the form // each array contains the input IDs of the fields we want to sum on each page // IDs do not need to be consecutive using this method $step_groups = array( 38 => array( 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 ) , 39 => array( 14 , 15 , 16 , 17 , 18 , 19 , 20 , 21 , 22 , 23 ) , 40 => array( 27 , 28 , 29 , 20 , 31 , 32 , 33 , 34 , 35 , 36 ) ); $score_total_key = 41; // loop through inputs for each step individually foreach( $step_groups as $subtotal_key => $field_keys ){ foreach( $field_keys as $idx => $field_key ){ $_POST['input_'.$subtotal_key] = ( !$idx ? 0 : $_POST['input_'.$subtotal_key] ) + rgpost( 'input_'.$field_key ); } } $_POST['input_'.$score_total_key] = 0; foreach( $step_groups as $subtotal_key => $v ){ $_POST['input_'.$score_total_key] += $_POST['input_'.$subtotal_key]; } // be sure to return the form when we're done return $form; } // http://www.gravityhelp.com/forums/topic/simple-calculations // change the 41 here to your form ID add_filter('gform_confirmation_41', 'ch_courage_confirmation', 10, 4); function ch_courage_confirmation($confirmation, $form, $lead, $ajax) { // beginning of the confirmation message $confirmation = "
'; // return the confirmation return $confirmation; }