From http://www.gravityhelp.com/documentation/page/Gform_after_submission
This code should be placed in the functions.php file of your active theme.