• Resolved sinapars

    (@sinapars)


    Hi Team,

    I am using the following filter to limit the submissions forms per user’s email per month, but unfortunately, each user can submissions several forms with one email.
    yours document:
    https://formidableforms.com/knowledgebase/frm_validate_entry/#kb-limit-submissions-per-time-period-or-any-stat
    Is this filter still valid?
    My code is:
    Field 182 is the email field of my users

    add_filter('frm_validate_entry', 'check_submitted', 20, 2);
    function check_submitted($errors, $values){
    	if  ( $values['form_id'] !== 6 ) {//Change 30 to the ID of your form 
    		return $errors;
    	}
    	
    	$entries_submitted = FrmProStatisticsController::stats_shortcode( array( 'id' => 182, 'type' => 'count', 'user_id' => 'current',  'created_at_greater_than' => 'this month' ) );//change the params to the params of your stat
    
    	if ( $entries_submitted >= 1 ){//change 1 to your limit number
    		$errors['too_many'] = 'You filled this form this month, please register the feedback in the next month.';//Change this to your error message
    	}
    
    	return $errors;
    }

    BR

Viewing 1 replies (of 1 total)
  • Plugin Support Njones35

    (@njones35)

    Hi there,

    Thanks for contacting us today. The code snippet you are trying to use requires the Pro version of Formidable Forms and will not work with our Lite plugin.

    I’m afraid that www.remarpro.com rules prevent us from offering support for the Pro plugin via these forums, so if you need more information or if you already have a Pro license, I would recommend opening a ticket in our helpdesk here:?https://formidableforms.com/new-topic/

    Best,
    Nathanael

Viewing 1 replies (of 1 total)
  • The topic ‘problem with limit submissions per time period’ is closed to new replies.