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.

Define two forms in gform_validation filter

  1. BIGLIFE
    Member

    I am trying to define two forms within the gform_validation filter. How might I call out the form ID since its not one of the function variables? I was trying an if/elseif statement (if($form['id'] = XX) but since the $form variable isn't called its giving the "Oops! We could not locate your form." error. any ideas?

    Posted 13 years ago on Wednesday December 14, 2011 | Permalink
  2. The gform_validation hook is passed the $validation_result variable. This contains the $form object as the "form" property:

    [php]
    $form = $validation_result["form"];

    Here is more thorough walk-through of this hook that might help:

    http://www.gravityhelp.com/documentation/page/Using_the_Gravity_Forms_%22gform_validation%22_Hook

    Once you've retrieved the $form object from the $validation_result, you're original logic would work. :)

    Posted 13 years ago on Wednesday December 14, 2011 | Permalink
  3. BIGLIFE
    Member

    Awesome David! Thx so much that worked great!

    Posted 13 years ago on Wednesday December 14, 2011 | Permalink
  4. My pleasure. :)

    Posted 13 years ago on Wednesday December 14, 2011 | Permalink

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