gform_is_valid_formula_form_editor

Description

JavaScript filter allowing the formula validation result to be overridden in the form editor.

Usage

gform.addFilter( 'gform_is_valid_formula_form_editor', function( result, formula  ) {
    // do stuff
 
    return result;
} );

Parameters

  • result string

    The validation result.

  • formula string

    The calculation formula being validated.

Examples

add_action( 'gform_admin_pre_render', 'check_formula' );
function check_formula( $form ){
	?>
	<script type="text/javascript">
		gform.addFilter( 'gform_is_valid_formula_form_editor', 'check_formula' );
		function check_formula( result, formula ){
			return result;
		}
	</script>
	<?php
	//return the form object from the php hook
	return $form;
}

Since

This filter was added in Gravity Forms version 2.4.6.8.

Source Code

This filter is located in the function IsValidFormula() in gravityforms/form_editor.js.