• Resolved ISObits

    (@isobits)


    When I leave a required field empty or insert invalid content an error ‘tooltip’ appears above the field saying things like ‘Fill in this field’ or something.

    I use YOOtheme’s Uikit and would like to replace this message with my custom html:

    <div uk-tooltip=”Bla di bla bla”></div>

    Is there any hook to replace the HTML’s error tooltip with my own?

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Author Konrad Chmielewski

    (@hwk-fr)

    Hello,

    Thanks for the feedback. ACF Forms error messages <div class="acf-notice -error acf-error-message"> are tied to ACF logic. I would advise to not change the markup, or at least the class names.

    If you want to add your own data attribute like uk-tooltip, you will have to add it with Javascript. Here is an example:

    
    (function($){
        
        if(typeof acf === 'undefined')
            return;
        
        acf.addAction('invalid_field', function(field){
    
            var $notice = field.$el.find('.acf-notice.-error');
    
            $notice.attr('uk-tooltip', 'My error');
    
        });
        
    })(jQuery);
    

    Have a nice day!

    Regards.

Viewing 1 replies (of 1 total)

The topic ‘Custom validation tooltip (html)?’ is closed to new replies.