jQuery UI Tooltip with jQuery Validate plugin

后端 未结 1 1091
伪装坚强ぢ
伪装坚强ぢ 2021-01-25 01:42

I\'m trying to use jQuery Tooltip to display a different colour tooltip for errors. I can do this fine with static content using the tooltipClass and styling that class appropri

相关标签:
1条回答
  • 2021-01-25 02:04

    As ninja said in the comment I just placed the above code in the errorPlacement function for the validate plugin:-

    errorPlacement: function(error, element) 
        {
            element.attr('title', error.text());
            $(".error").tooltip(
            {   
                position: 
                {
                    my: "left+5 center",
                    at: "right center"
                },
                tooltipClass: "ttError"
            }); 
        }
    
    0 讨论(0)
提交回复
热议问题