Gform pre submission


This action hook is executed after form validation, but before any notifications are sent and the entry is stored. This action can be used to modify the posted values prior to creating the entry.


Applies to all forms

add_action("gform_pre_submission", "pre_submission");

Applies to a specific form. In this case, form Id 5

add_action("gform_pre_submission_5", "pre_submission");



(Form Object) The current form.


This example changes the post variable for field 14;


add_action("gform_pre_submission", "pre_submission_handler");
function pre_submission_handler($form){
    $_POST["input_14"] = "new value for field 14";


This code should be placed in the functions.php file of your active theme.

Source Code

This action hook is located in form_display.php

Search the Documentation