1
votes

following this article:

http://techslides.com/editing-gravity-forms-entries-on-the-front-end

trying to get gravity forms to update a submission rather than create a new one.

problem is that in the

/* https://www.gravityhelp.com/documentation/article/gform_pre_submission */
add_action("gform_pre_submission", "pre_submission_handler");
function pre_submission_handler($form){

if ( strpos($_SERVER['REQUEST_URI'], 'application-edit', 0) !== false ) {
    //Get original entry id
    parse_str($_SERVER['QUERY_STRING']); //will be stored in $entry

    //get the actual entry we want to edit
    $editentry = GFAPI::get_entry($entry);

    //make changes to it from new values in $_POST, this shows only the first field update
    $editentry[1]=$_POST['input_1'];

    //update it
    $updateit = GFAPI::update_entry($editentry);

    header("Location: http://yourdomain.com/apply/application-thank-you/");

    //dont process and create new entry
    die();
 }

}

section of the code, the header redirect is not functioning. Any suggestions?

1

1 Answers

1
votes

Gravity Forms makes it pretty easy to update an existing entry via the gform_entry_id_pre_save_lead filter. More information and usage example here:

https://www.gravityhelp.com/documentation/article/gform_entry_id_pre_save_lead/#examples