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.

One or x submissions per form per user

  1. simbian
    Member

    Hello to all, according to Chris moderation in this thread http://www.gravityhelp.com/forums/topic/only-one-submission-per-forms?replies=13#post-38054 i open this new one.

    There are new solutions to set max number of submissions (from 1 to xxx) per registered user? It's also possible to set a kind of expiration?
    I mean if for example i wanna allow every user to make one submission a day, the next day they should be able to do another one submission and if they try to make more than one submission per day a warning message will be displayed.

    Thanks
    Simone

    Posted 13 years ago on Tuesday October 18, 2011 | Permalink
  2. Quick and dirty - make a PHP function to concatenate logged in user email with current date, then set that field to admin only / no duplicates.

    add_filter('gform_field_value_user_serial', 'gravity_serial'); 
    
    function gravity_serial() {
      global $current_user;
    
      if (is_user_logged_in()) {  // Are they logged into WP account?
    		foreach($current_user as $key => $value){
          			if($key == 'user_email')
          			$meta_value = $value . date("Y-m-d");
          			}
    	 } else {			   // otherwise return error
    		$meta_value = 'ERROR';
    	}
    	return $meta_value;
    }

    I am not 100% sure about combining the string with a PHP function, but if it doesn't work you can declare a date string and then combine the two strings instead.

    Still kinda new to PHP

    Posted 13 years ago on Tuesday October 18, 2011 | Permalink
  3. Thank you for starting a new topic.

    In Gravity Forms 1.6, there are options to limit submissions to a certain number per:

    • day
    • week
    • month
    • year

    Yes, you can set an expiration, so there are no form submissions allowed after a specific date.

    Posted 13 years ago on Tuesday October 18, 2011 | Permalink
  4. simbian
    Member

    thanks Scott for the code, however maybe is better and more easy to do with Gravity Forms 1.6, this is a great news Chris! I will wait for the final version public available.

    So now the only "problem" is to "assign" the form submission for each single registered user. Any help to deal with this new Gravity Forms version and Wordpress 3.1.2?

    Thanks again!

    Posted 13 years ago on Tuesday October 18, 2011 | Permalink