Please Note: We are no longer using forums to facilitate standard support. 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.

gform_validation filters don't seem to be picking up form

  1. I'm not sure Gravity Forms is picking up my custom validation. I've added it to the functions.php file of the theme at the end of the file. I'm not getting any PHP errors but it doesn't seem to be working. For the validations filter function I'm using the example and have only modified the items below. I tested out the actual validation function (is_serial) separately and it functions correctly. I have no idea why it's not picking up the form data or applying the filter.

    add_filter('gform_validation_13', 'lx_validate_serial', 10, 2);
    
    function lx_validate_serial($validation_result) {

    ... same as example code ...

    // If the field does not have our designated CSS class, skip it
    if(strpos($field['cssClass'], 'lx_serial') === false)

    ... same as example code ...

    // Make a call to your validation function to validate the value
    $is_valid = is_serial($field_value);

    ... same as example code ...

    $field['validation_message'] = 'The serial number you have entered is not valid.  Please verify the serial number on your device';

    ... same as example code ...

    }
    Posted 4 years ago on Thursday August 18, 2011 | Permalink
  2. Those should go in the functions.php file in your theme folder.

    http://www.gravityhelp.com/documentation/page/Where_Do_I_Put_This_Code%3F

    Posted 4 years ago on Thursday August 18, 2011 | Permalink
  3. Thanks, I saw it belatedly. Then I went back and modified the post since that is where I put it and it still doesn't seem to be applying the filter.

    I would have deleted the post and started over but that wasn't an option.

    Posted 4 years ago on Thursday August 18, 2011 | Permalink
  4. You know what, never mind. I've got a nasty head cold that is making me stupid. I am editing the code on the wrong box. Thanks for your help.

    Posted 4 years ago on Thursday August 18, 2011 | Permalink
  5. LOL. Okay Tom. Hope you get to feeling better.

    Posted 4 years ago on Thursday August 18, 2011 | Permalink

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

Support Tickets

Open A New Support Ticket
 Open A New Priority Support Ticket *

* Developer license holders only