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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T06:49:52+00:00 2026-05-23T06:49:52+00:00

I am a newbie to jQuery and I aplogize if this question is very

  • 0

I am a newbie to jQuery and I aplogize if this question is very basic.

I am using bassistance’s Valiation plugin to validate a simple form. One of the text fields is mandatory – so I set required flag under rules and a corresponding message under messages. The problem I have is, once the validation kicks in, the error message I’ve set is displayed even if the field is blank (meaning, if the user deletes the contents of the field to start from scratch). Is there anyway to clear the error message or reset the validation if the field becomes empty? I tried to use the resetForm(), but looks like I can’t use it while it’s still validating. Here’s part of the code:

$(document).ready(function() {

  var validator = $("#form1").validate({
     rules: {
         fname: {
             required: true,
             remote: 'http://localhost/check_name.php'  
         }
       },
     messages: {
         fname: {
             required: "Enter a valid jobname. eg: 99999_Disney",
             remote: "Name already exists";
                    }   

               } 
  });

Thanks for your help!

  • 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-23T06:49:53+00:00Added an answer on May 23, 2026 at 6:49 am

    I solved the problem. Not sure if it’s the most elegant way to do it, but it works. I had to clear the invalid state of the field somehow. I tried resetForm() but that didn’t work. In the end I used something like this:

    if ($("#ID").val()=="") {
                    validator.resetForm();
                    $("#ID").rules("remove", "required minlength");
            }
    

    and as needed added those rules back to the ID using:

    $("#ID").rules("add", {
                                 required: true,
                                 minlength: 5,    
                                 messages: {//messages
                                 },                             
                    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am an absolute newbie to jquery. So this might be a very basic
This may be a basic question... but I am a newbie to jquery. I
I am newbie to jQuery, can someone explain what this code does: $(#currency form).submit(function(e)
I'm a newbie in jQuery... I've used one jQuery plugin (Actually SimpleModal Plugin) in
I'm newbie to jquery and I know that my question is simple. I would
I am newbie to jQuery. I have a form like this <select name= menus>
jQuery-newbie here. I want to do a simple horizontal scroll function with two buttons.
I'm a jQuery newbie as of this morning, and this is the code I've
am newbie to jquery..I have a three steps registration form in which the user
I'm newbie with JQuery. I got this function function verify_at_bd() { var u =

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.