PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Disable Submit Button writing to Database

  1. vixvii
    Member

    I am using a GF to edit details pulled from the database. I would like to replace the Submit button with an Update Button. I don't want the values to be written to the GF database, seeing that this form will actually be editing values.

    I can use the gform_pre_submission function to do the update, but can I stop it from writing to the database?

    Alternatively... Can I hide the Submit button and just add another button?

    Posted 13 years ago on Thursday June 30, 2011 | Permalink
  2. Gravity Forms automatically saves the entry data and currently there is no option to turn this off. You can, however, automatically delete the entry when a form is submitted. Here is some information on how to do this:

    http://www.gravityhelp.com/forums/topic/purposefully-not-save-form-in-entries-database#post-15601

    If you want the Submit button to say Update then simply edit that form, select Form Settings and change the text on the Submit Button so it say's Update.

    Posted 13 years ago on Thursday June 30, 2011 | Permalink
  3. vixvii
    Member

    Thanks Carl... and any chance I can hide the button with a conditional and display a custom button instead? Then I can maybe attach the update function to the other button and the user will not press the Submit button. Otherwise deleting the entry will be 2nd choice :-)

    Posted 13 years ago on Thursday June 30, 2011 | Permalink
  4. vixvii
    Member

    I thought I could maybe disable the submit button and just put a shortcode button underneath the form on the page, but then it gets tricky to access the values on the form... Or am I missing something?

    Posted 13 years ago on Thursday June 30, 2011 | Permalink
  5. I think the easiest solution is to use the gform_post_submission hook and perform your update there. Then delete the entry that was just created by Gravity Forms.
    You can dynamically change the label of the button by using the gform_pre_render hook.
    You can view documentation for these hooks in our Developer Docs section: http://www.gravityhelp.com/documentation/page/Developer_Docs

    Posted 13 years ago on Thursday June 30, 2011 | Permalink
  6. vixvii
    Member

    Thanks Alex... looks like deleting is the way to go.

    Posted 13 years ago on Friday July 1, 2011 | Permalink

This topic has been resolved and has been closed to new replies.