Custom Gravity Forms Popup Error Message

, , ,

Here is a sample of code on how to show a custom popup error message.

add_filter( 'gform_validation_message_3', 'sw_gf_validation_message', 10, 2 );

function sw_gf_validation_message( $validation_message ) {
    add_filter( 'wp_footer', 'sw_gf_js_error' );
}
function sw_gf_js_error() { ?>
    <script type="text/javascript">
        jQuery(".gfield_error").removeClass('gfield_error');
        jQuery(".validation_message").hide('fast', function() {
            alert( "Please check that you are entering a valid email address." );
        });
        
    </script>
<?php }

 

 

Skills

Posted on

October 25, 2016

2 Comments

  1. Mariusz

    Constant php errors 🙁

    Reply
    • greg

      What are the PHP Errors that you are receiving? This code should be a fairly straight forward WP add_filter call with no other PHP errors. You want to make sure you place this code before the close ?>

      Reply

Submit a Comment

Your email address will not be published. Required fields are marked *