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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T03:08:37+00:00 2026-06-13T03:08:37+00:00

I have a weird bug with JQuery Validate and a custom method. For some

  • 0

I have a weird bug with JQuery Validate and a custom method. For some reason, the validate method fires 3-4 times every time the field is changed. It’s looping for some reason, and I have no idea why. The validator works. The only problem is that it is not working with datepicker. I have to click twice in the datepicker to get the value in the input to change. It seems like jquery validate is hijacking the datepicker input, or something. I’m clueless at this point and will entertain any ideas.

The custom method:

$(document).ready(function () {

    $.validator.addMethod("laterDate", function(value, element) {   
       var id = "#" + element.id;
       var id_number = element.value.charAt(element.length - 1);
            alert(id_number);
       if(id_number == "1"){
            alert("in if")
            var id_value = $(id).fieldDate();
            var today = new Date();
                alert(id_value > today);
                return id_value > today;
      }
        else{
        alert("in else")
        var prev_id_number = String(parseInt(id_number) - 1);
        var prev_id = "#end_date_" + prev_id_number;
        var prev_id_value = $(prev_id).fieldDate();
        var id_value = $(id).fieldDate();
        return id_value > prev_id_value;
      }

    }, $.format("Enter a later date"));
});

The validator code is:

$(document).ready(function () {
    $("#rate_new_new").validate({
        debug: true,

rules: {
                "rates[start_date_1]": {dateITA: true, maxlength: 50},
                "rates[end_date_1]": {dateITA: true, maxlength: 50, laterDate: true},
                "rates[price_1]": {testPrice: true}
                },
    messages: {

        "rates[start_date_1]": {
            dateITA: "Please enter a valid date",
            maxlength: "The name must be less than 50 characters"

        }
    },      

    submitHandler: function(form) {

                $(form).ajaxSubmit({

                        success: function(){
                          $('#lefttabs li:eq(4) a').tab('show');
                                            }
                                  });


                                  }
 });
 });
  • 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-06-13T03:08:38+00:00Added an answer on June 13, 2026 at 3:08 am

    Are you using JqueryUIDatePicker?

    Than, try this:

    $('#yourid').datepicker({
        onSelect: function(dateText, inst) {
            $(this).blur();
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i'm trying to get started with silverlight 2. i have a weird bug. every
I have this supper weird bug, where this method fails in IE9. What is
I have noticed some weird behaviour in Chrome 15 and Safari regarding jquery hover
I've got some weird bug and I have to deep inspect my layout and
I have a weird bug in Chrome which affects a page in Wordpress. I
I believe I have found a weird bug as follow: I want to delete
I have a weird question. After profiling my code several times with NYTProf. I
i have a rather weird problem that should fix a bug in my current
I have a weird bug in my application that causes an activity to relaunch
This has been driving me nuts all day. I have a weird bug that

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.