save and finish later function? (5 posts)

  1. masglobal
    Posted 4 years ago #

    Hi, I am creating a form that would take a visitor over an hour to finish so having a save button to come back and finish later is necessary.

    Is this function available?



  2. masglobal
    Posted 4 years ago #


  3. Yogi-bear
    Posted 3 years ago #

    I also need to create a form with a 'Save' button.
    Does anyone have a suggestion?

  4. mcbmcb0
    Posted 3 years ago #

    i never found a free one, tho i think ninja forms (paid) may offer this.
    the other option is write your own, or edit an existing plugin. most of those i looked at write each submission to a table, rather than overwrite old entries for the user's id. that maybe coz wordpress (wpdb) doesn't appear to have an easy sql function to 'insert... or on duplicate update' - so you'll have to write one of those too using php with or without wpdb. here was my inefficient version - it makes 3 database requests per update:

    $all_rows = $wpdb->get_results( $wpdb->prepare("SELECT * FROM ".$table." WHERE ".$id_field." = '".$value."'") );
    	$num_rows = $wpdb->num_rows;
    	if ($num_rows==0){ // insert new
    		$is_er = $wpdb->prepare($wpdb->insert($table, $data, $sql_data));
    	if ($num_rows==1){ // update if 1
    		$is_er =$wpdb->prepare($wpdb->update($table, $data, array($id_field => $value), $sql_data));//

    or just purge the table of all existing entries for the id before you write
    e.g.: $wpdb->query($wpdb->prepare(" DELETE FROM " . $table . " WHERE registration_id ='" . $registration_id."'"));

    then of course you've got to get your answers out using sql... So it gets pretty ugly. I wish some clever plugin person could do it all for us

  5. Yogi-bear
    Posted 3 years ago #

    Thanks for the reply.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • FormBuilder
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic