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.

Gform_field_value_ filter firing twice

  1. I have a form with a trigger on it. The gform_field_value_ filter triggers twice: once for the form and once for the javascript. It does so without passing in the value from the previous pass.

    I need to do something like this:

    add_filter( 'gform_field_value_my_rand', 'gform_field_value_my_rand' );
    function gform_field_value_my_rand( $value ){
      if( !$value ) :
        $value = 'sliceofcheese' . sprintf( "%05d", rand(0,99999) );
       endif;
      return $value;
    }

    Is this deliberate behaviour?

    Posted 12 years ago on Friday July 6, 2012 | Permalink