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.

i didn't get good value when i received notification

  1. creativexperience
    Member

    Hi,
    I use imput hidden field. i follow your instructions but i get an error, i have 3 forms i use
    i didn't get good value when i received notification

    i add in my function.php, this code ( i follow instruction from http://www.gravityhelp.com/forums/topic/how-to-put-in-notification-title-the-date-hours )

    add_action("gform_pre_submission", "pre_submission_handler");
    function pre_submission_handler($form){
    $_POST["input_25"] = date('G:H:s');
    $_POST["input_24"] = date('G:H:s');
    $_POST["input_16"] = date('G:H:s');
    }

    How i can specify which input i must use for each form (Form contact / Form Request / Form offer) ?

    Posted 6 years ago on Wednesday January 16, 2013 | Permalink
  2. What are input_25, input_24 and input_16? Are those all hidden fields in one form?

    The 25 (or any of those input numbers) should be the ID of the hidden field where you want to store the date. Can you tell us what field ID you want to store the date in?

    Sounds like you have 3 forms as well. You might have to create three functions, each one tied to a different form. But we need to get one working properly before expanding that into 3 forms and 3 different field IDs.

    Posted 6 years ago on Wednesday January 16, 2013 | Permalink
  3. creativexperience
    Member

    No,
    input_25 is for the first form
    input_24 is for the second form
    input_16 is for the third form

    that's why i don't get good value when i receive notifications
    i think i mut give value for $form ?

    Posted 6 years ago on Thursday January 17, 2013 | Permalink
  4. You need to specify the form ID. There are a couple ways to do it.

    1) You can create three functions (they need unique names):

    // this will apply to form ID 1
    add_action('gform_pre_submission_filter_1', 'pre_submission_one');
    	// this is the ID of the hidden field for form 1
    	function pre_submission_one($form){
    	$_POST['input_25'] = date('G:H:s');
    	return $form;
    }
    
    // this will apply to form ID 2
    add_action('gform_pre_submission_filter_2', 'pre_submission_two');
    	function pre_submission_two($form){
    	// this is the ID of the hidden field for form 2
    	$_POST['input_24'] = date('G:H:s');
    	return $form;
    }
    
    // this will apply to form ID 3
    add_action('gform_pre_submission_filter_3', 'pre_submission_three');
    	function pre_submission_three($form){
    	// this is the ID of the hidden field for form 3
    	$_POST['input_16'] = date('G:H:s');
    	return $form;
    }

    Just change the form ID in the first line of the function and match the field ID to correspond with the form ID.

    You could also do it with one function, then test the form ID and based on the form ID populate a specific field ID. If the previous approach does not work, I will post this other method for you.

    Posted 6 years ago on Thursday January 17, 2013 | Permalink
  5. creativexperience
    Member

    Great, Thanks very much ! Now all is good :)

    Posted 6 years ago on Thursday January 17, 2013 | Permalink
  6. Thank you for the update.

    Posted 6 years ago on Thursday January 17, 2013 | Permalink

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