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 6824099
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:51:43+00:00 2026-05-26T21:51:43+00:00

I have looked everywhere for the answer to this question and while there are

  • 0

I have looked everywhere for the answer to this question and while there are many questions that are similar, none work exactly like I want.

I am using JQuery Validator Plugin for a webform. Due to design constraints, I do not want the error message to be appended to the previous element. Currently, I have it working where it adds a specific class to the input that is invalid, using highlight as well as adding a summary to the bottom of the form. No problems there.

However, I find that this alone is not enough as the user really still has no idea why the particular spot is invalid. I have really no space to automatically display the error message; however, I read in the documentation that you can add the error message to the title attribute which is what I want to do. Quoted from, site:

An error message displays a hint for the user about invalid elements, and what is wrong. There are three ways to provide error messages. Via the title attribute of the input element to validate, via error labels and via plugin settings (option messages).

However, it does not show how to actually add the error message to the title attribute. So, here is what I have so far, what can I do in this situation?

FYI: I realize that I will have to add the error messages back in instead of having “” as the message.

$(document).ready(function() {
    $("#popcornOrder").validate({
            rules: {
                fName:      "required",
                lName:      "required",
                street:     "required",
                city:       "required",
                state:      "required",
                zip:        {required: true, ziprange: true},
                accountNum: "required",
                email:      {required: true, email: true},
                pwd:        "required",
                confPwd:    {required: true, equalTo: "#pwd"},
                payment:    "required"
            },
            messages: {
                fName:      "",
                lName:      "",
                street:     "",
                city:       "",
                state:      "",
                zip:        "",
                accountNum: "",
                email:      "",
                pwd:        "",
                confPwd:    "",
                payment:    ""

            },
            highlight:
                function(element) {
                    $(element).addClass('errorBorder');
                },
            unhighlight:
                function(element) {
                    $(element).removeClass('errorBorder');
                },
            invalidHandler: function(form, validator) {
                var errors = validator.numberOfInvalids();
                    if (errors) {
                         var message = errors == 1
                            ? 'You missed 1 field. It has been highlighted'
                            : 'You missed ' + errors + ' fields. They have been highlighted';
                         $("div.error span").html(message);
                         $("div.error").show();
                         } else {
                        $("div.error").hide();
                    }
             },
             focusInvalid: false
    });
});

EDIT: Okay, I did get one step closer: if I add the following line it will add a message to the title attribute (this was just regular ol JQuery), BUT it adds the the message summary to ALL titles. So, the real question then is how to add the specific errors to each of the inputs?

$("input").attr("title", message);
  • 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-26T21:51:44+00:00Added an answer on May 26, 2026 at 9:51 pm

    You need to uniquely identify the input.

    $("input[name=foo]").attr("title", message);
    

    Where foo is the name of the input. I suspect this will coincide with the name of the rule that was broken (e.g. fName, lName, etc). Obviously you’ll need to do this for each error you have.

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

Sidebar

Related Questions

I have looked everywhere for the answer to this question, but cannot find anything
I have looked around on the Internet trying to answer this question. It seems
I have looked for an answer for this nearly every where that I can
I've looked everywhere for the answer to this question but cant find anything so
I've looked everywhere for this but can't find an answer, so: I have a
I have looked everywhere but have not found a problem similar to this. I
I have looked everywhere on the internet and can not find this answer. Do
I have looked at the Suggested related questions but none of them are what
I've looked everywhere for an answer on this, but haven't had any luck. I've
I have looked everywhere and it seems that it is currently not possible to

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.