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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T23:12:49+00:00 2026-05-21T23:12:49+00:00

I use jQuery validate to validate a bunch of forms on a site that

  • 0

I use jQuery validate to validate a bunch of forms on a site that I’m working on.

On this site I clone some inputs depending on a select option selection. I want to validate these inputs, but when I do, only the first one gets validated.

I tried to put $('form').validate(); within the clone script, where a bunch of other scripts are placed (and works), but it still only validates the first.

What should I do?

Below is my clone script, where I believe a new validate() should be placed. Or what?

// Clone per number chosen
for (var i = 0; i < childrenCount; i++) {
    birthday
        .clone()
        .attr('name', birthday.attr('name') + count++ - 9)
        .appendTo('.childInputs')
        .children("input.childDD").attr('id', 'child' + count + 'DD')
        .next("input.childMM").attr('id', 'child' + count + 'MM')
        .next("input.childYYYY").attr('id', 'child' + count + 'YYYY')
        .parent().children('.noChild').html(count);

    $(this).parent().next(".linkedToPrev").slideDown('slow');
    $("input.yyyy").mask("9999",{placeholder:" "});
}

I will not post all the code because it’s pretty complex. If you don’t know, on the top of your heads, what might cause the problem, I will though.

  • 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-21T23:12:49+00:00Added an answer on May 21, 2026 at 11:12 pm

    If you are dynamically adding elements, and are using normal event binding methods with jQuery the new elements are not automatically bound unlesss you use the $.live() handler:

    $('form').live('submit', function() {
       var $inputs = $('input', this); //this selects all inputs within the form
       //do validation
    });
    

    I’m sure you are doing something similar now, but that will bind for all existing form elements and all future form elements added. When a submit event fires the script will grab all existing input elements within the form firing the event, which you can then iterate through and validate.

    Hope this is what you were looking for.

    EDIT: Since someone revived this 4 year old post, mentioning .live() is deprecated here is the modern jQuery way of doing even delegation to document:

    $(document).on('submit', 'form', function () {
        //...
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

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.