Support

Account

Home Forums ACF PRO trigger event on field losing focus Reply To: trigger event on field losing focus

  • Hi @marathra

    You should be able to do it by using the jQuery focusout() method and acf/input/admin_footer hook to add the script. It should be something like this:

    function my_acf_script_focusout() {
        ?>
        <script type="text/javascript">
        (function($){
    
            $(document).ready(function(){
                
                $(".acf-field-1234567890abc input").focusout(function(){
                    alert( $(this).val() );
                })
    
            });
    
        })(jQuery);
        </script>
        <?php
    }
    
    add_action('acf/input/admin_footer', 'my_acf_script_focusout');

    Where ‘acf-field-1234567890abc’ is based on the field key of your email custom field.

    I hope this helps 🙂