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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T14:28:34+00:00 2026-05-14T14:28:34+00:00

This works: $([id$=’_zzz’]).rules( add, { required: true, minlength: 8, messages: { required: …, minlength:

  • 0

This works:

$("[id$='_zzz']").rules(
    "add",
    {
        required: true,
        minlength: 8,
        messages: {
            required: "...",
            minlength: jQuery.format("...")
        }            
    }
);

The error message comes up.

When I try to style the message, this doesn’t work:

$("[id$='_zzz']").rules(
    "add",
    {
        required: true,
        minlength: 8,
        messages: {
            required: "...",
            minlength: jQuery.format("...")
        },
        errorElement: "span",
        errorPlacement: function(error, element) {
            error.insertAfter(element);
            error.css("margin", "0 0 0 5px");
        }             
    }
);

When I style via the validate function, the styling is applied so it works:

$('#aspnetForm').validate({
    errorElement: "span",
    errorPlacement: function(error, element) {
        error.insertAfter(element);
        error.css("margin", "0 0 0 5px");
    }
});

Why can’t I style using errorplacement in the rules add function?

  • 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-14T14:28:34+00:00Added an answer on May 14, 2026 at 2:28 pm

    In the first method, you’re passing a errorPlacement property/function on the object to the rules method…it simply doesn’t care of check for this and doesn’t use it. For any object you pass in to javascript it has to check for that property or make use of it in some manner, otherwise it’s just extraneous information. You could add myExtrathing:'ValueHere' to the object as well, wouldn’t break anything…but wouldn’t be used either.

    The .validate() method has an existing errorPlacement function (that is actively uses, that’s the important part, it’s looking for it) in the default options and performs an extend to replace the default method with the one your provided…if you provided one. This same behavior is true for almost every jQuery plugin and any option you specify, it merges the default options with the ones you provide/override. You can see some simple examples of this behavior in the jQuery plugin authoring manual.

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

Sidebar

Related Questions

This works great: <my:DatePicker IsTodayHighlighted=True Width=200> </my:DatePicker> But I want to format the date,
This works just fine in jQuery 1.6.4 for dynamic html: $(.selector).die().live(click, function () {
This works: print Hello World%s %! But this doesn't print Hello%20World%s %! the error
This works: help(package=ggplot2) This does not: x <-ggplot2 help(package=x) # Error in find.package(pkgName, lib.loc,
This works fine class Window.AppViewModel message : ko.observable() chatMessages : ko.observableArray() canSendMessage : ko.observable(false)
This works. $(document).ready(function(){ $(.items article).click(function(){ window.location=$(this).find(a).attr(href); return false; }); }); However , when the
This works but for some reason the comma is missing. data gets inserted as
This works: <cfdirectory action=list name=qry directory=C:\inetpub\wwwroot\Atlas\ > </cfdirectory> <cfdump var=#qry#> So I know that
This works in chromium (and I assume every other major browser) -html- <invalid></invalid> -css-
This works when I have only one state code as a parameter. How can

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.