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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T07:10:12+00:00 2026-05-13T07:10:12+00:00

So I have this jQuery Validation plugin, and it has a custom success message.

  • 0

So I have this jQuery Validation plugin, and it has a custom success message. The form validates automatically, because it’s attached to the body. The problem comes when I wish to check the variable to see if the form is valid. That revalidates it, which ends up adding an extra success message (image in my case) which is undesired. I want the success message to only appear once, regardless of the fact it is validated multiple times. Here’s my code:

  $("#makeaComment").validate({
   errorContainer: ".error",
   errorPlacement: function(error, element) {
    error.appendTo( element.next() );
   },
   success: function(label) {
    label.removeClass("error").addClass("check");
   }
  });

  $("#loginAction").click(function() {
   if ($("#makeaComment").valid()) {
    commentLogin();
   }
   else {
    $('#loginAction').attr('value','Fix Errors and Continue');
   }
  });

Thanks!

  • 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-13T07:10:13+00:00Added an answer on May 13, 2026 at 7:10 am

    With the success function just make sure to either check if the image is already there or clear everything there and add your image. I would go with the former.

    Looking at the script it seems it may be making many elements for the error. So instead of removing the class error and adding checked try just adding checked as a new element once. But be sure to remove that class when showing an error.

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

Sidebar

Related Questions

I have this AJAX submission form written with the jQuery validation plugin. It all
I have a form that uses the excellent jQuery validation plugin. This is a
I have a form using jquery validation plugin. My submit button has an ajax
I am using the jquery validation plugin to validate a form. I have the
I'm new to jQuery but want to use this form validation plugin: http://bassistance.de/jquery-plugins/jquery-plugin-validation/ In
I'm using the jQuery validation plugin found here: http://plugins.jquery.com/project/validate In my form I have
I have been using jquery validate plugin http://bassistance.de/jquery-plugins/jquery-plugin-validation/ . It has been working successfully,
Using jQuery validation plugin but it has no CSV validation. I have made an
I have a jquery validation plugin. I don't want my form to submit if
I have a form with several fields and using jQuery validation plugin. My input

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.