Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4558200
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T17:36:57+00:00 2026-05-21T17:36:57+00:00

Im trying to display error messages for the jquery validator plugin(the bassistance one) as

  • 0

Im trying to display error messages for the jquery validator plugin(the bassistance one) as a tooltip above the component when the validation fails. The tooltip(also the bassistance one) just wont show, so I was wondering how to get this stuff working. My code so far:

$("#loginForm").validate({       
    errorPlacement: function(error, element) {
        $(element).tooltip({
            content: 'the error message goes here'
        });
    }
});

Also, I was wondering how I can get hold of the actual localised error message to display. I do not want to hardcode it into the tooltip as I’ve done in the snippet above.

Any help is much appreciated! 😉

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T17:36:57+00:00Added an answer on May 21, 2026 at 5:36 pm

    One way for doing this (without tooltip plugin) is with some off css code and some of imagination:

    $("#frmArticle").validate({
        submitHandler: function(form) {
            form.submit();
        },
        onfocusout: function(element) {
            //To remove the 'checked' class on the error wrapper
            var $errorContainer = $(element).siblings(".Ntooltip").find("label");
            $errorContainer.removeClass("checked");
            if ( !this.checkable(element)) {
                this.element(element);
            }
        },
        rules: {
            name: {
                required: true
            }
        },
        errorPlacement: function(error, element) {
            var container = $('<div />');
            container.addClass('Ntooltip');  // add a class to the wrapper
            error.insertAfter(element);
            error.wrap(container);
            $("<div class='errorImage'></div>").insertAfter(error);
        },
        success: function(element) {
            $(element).addClass("checked");
        }
    });
    

    Instead of only a label for errors i create this html for errors:

    <div class="Ntooltip">
       <label for="nombre" generated="true" class="error">Requerido</label>
       <div class="errorImage"></div>
    </div>
    

    With css code we are going to hide this labels to the user. But the errorImage is always visible (when the element is created, of course). And, when the user hover over it, the label will show:

    div.Ntooltip {
    position: relative !important; /* es la posición normal */
    display: inline-block;
    top: -0.2em;
    left: 0.2em;
    }
    
    div.Ntooltip:hover {
        z-index:1005; /* va a estar por encima de todo */
    }
    
    div.Ntooltip label {
        display: none !important; /* el elemento va a estar oculto */
        vertical-align: middle;
    }
    
    div.Ntooltip:hover label.error:not(.checked) {
        display: inline-block !important; /* se fuerza a mostrar el bloque */
        position: absolute; /* se fuerza a que se ubique en un lugar de la pantalla */ 
        left:2em; /* donde va a estar */
        width:auto; /* el ancho por defecto que va a tener */
        padding:5px; /* la separación entre el contenido y los bordes */
        background-color: #ff6611; /* el color de fondo por defecto */
        border: 3px coral solid;
        border-radius: 0.5em;
        color: white;
        opacity: 0.85;
    }
    
    label.error + div.errorImage {
        background:url("../img/error.png") no-repeat 0px 0px;
        display:inline-block !important;
        width:22px;
        height:22px;
        vertical-align: middle;
    }
    
    label.checked + div.errorImage {
        background:url("../img/valid.png") no-repeat 0px 0px;
        display:inline-block !important;
        width:22px;
        height:22px;
        vertical-align: middle;
    }
    

    And for making the tooltips visible out of the bounds of its parents you must change the parent’s overflow property to visible. If you are using jQueryUI see the css for making those changes.

    overflow: visible;
    

    And this is how it looks:

    validation

    Edit: Created JSFiddle for demonstration, updated onfocusout method

    https://jsfiddle.net/2vc5vmr0/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When trying to display a byte stream from HLDS (Half-Life Dedicated Server) in a
I've been trying to display text using a Quartz context, but no matter what
I'm trying to display a series of titles varying from 60 characters to 160
I am trying to display a list of all files found in the selected
I'm trying to display a loading icon while my iPhone app downloads a network
I'm trying to display an array of files in order of date (last modified).
I'm trying to display a caret ( ^ ) in math mode in LaTeX
I am trying to display a pie chart that shows sales by company. However
I'm trying to display a picture in an openGL environment. The picture's origninal dimensions
I'm trying to display an address right aligned in the footer of my page

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.