We are using gravity forms as an anonymous way for users to submit suggestions to a CEO. Is tehre a way to disable the form entry manager feature so that it does not save entries?
We are using gravity forms as an anonymous way for users to submit suggestions to a CEO. Is tehre a way to disable the form entry manager feature so that it does not save entries?
Here is a thread about that:
http://www.gravityhelp.com/forums/topic/purposefully-not-save-form-in-entries-database#post-15601
Guys, that sort of hoopla to stop a form from saving entries makes no sense.
In GFFormsModel::save_lead() wouldn't the following Just Work(tm)?
`
if($lead == null && apply_filters( "gform_save_lead", $form, true ) { ... } else return;
`
Step earlier in GFFormDisplay::handle_submission probably makes more sense.
Can you give more information so that when our developers look at this on Monday, they'll have all the information they need to respond? Walk me through your thought process more. Gravity Forms was designed by default to save leads to the database, and it is rare that someone doesn't want it to do that.
Well, in this scenario I have a simple selection of dropdowns that the user can operate with. There is no textual input. It's just a utility filter form, I have no interest in the selections the users make. I could code this by hand, but the GUI form editor and other goodness makes me want to use GF and get it over with.
Since I don't need any validation, this works for me in this scenario:
function io_form_pre_validation( $form ) {
if ( ! isset( $form[ "id" ] ) ) return $form;
if ( $form[ "id" ] != 5 ) return $form;
foreach ( $form[ "confirmations" ] as $c ) {
if ( $c[ "type" ] == "redirect" && isset( $c[ "url" ] ) )
wp_safe_redirect( $c[ "url" ] );
exit;
}
}
add_filter( "gform_pre_validation", "io_form_pre_validation" );
But if I did want the GF validation goodness in some form, yet don't need the leads saved, then I'd really like to be able to be able to add_filter-override the handle_submission -> save_lead chain.
Thanks for the suggestion. That hook does make sense. I will be looking at adding that in a future version.
EDIT: Actually, I need to take another look at this. There are some things such as notification and Add-Ons that do require an entry to be created, so even though that filter will "work" and the entry won't be saved, it could also create issues in other areas.