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

  • Home
  • SEARCH
  • 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 5928291
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T14:16:31+00:00 2026-05-22T14:16:31+00:00

I have used jQuery.validator.addMethod to create a custom validate method that will make sure

  • 0

I have used jQuery.validator.addMethod to create a custom validate method that will make sure there is at least one row in my data-entry table. Using Firebug, my breakpoint in the method isn’t being hit at all. Am I missing something?

Note: I am sure there are problems with the validation method itself, but that is because I can’t debug it yet. I am still very much a novice with JavaScript.

Update: I have figured out that it isn’t getting triggered because I didn’t have the validator on an input field. I have it working now, however, is there a way to add a validation without attaching it to an input field?

Here is what my table looks like:

<table id="editorRows">
    ...
    <tbody class="editorRow">
        <tr class="row1">
        </tr>
        <tr class="row2" style="display: none;">
        </tr>
        <tr class="row3" style="display:none;">
        </tr>
    </tbody>
    <tbody class="editorRow">
        <tr class="row1">
        </tr>
        <tr class="row2" style="display: none;">
        </tr>
        <tr class="row3" style="display:none;">
        </tr>
    </tbody>
</table>

Here is my custom validator:

jQuery.validator.addMethod('required_row', function(val, el) {
    var rowCount = $("#editorRows tbody").length;
    if (typeof rowCount != "undefined") {
        return (rowCount > 0);
    } else {
        return false;
    };
}, "Your request must contain at least one day.");

// Validate the form before submitting
$("form").validate({
    rules: {
        "#editorRow": { required_row: true }
    }
});
  • 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-22T14:16:32+00:00Added an answer on May 22, 2026 at 2:16 pm

    I have figured out that it isn’t getting triggered because I didn’t have the validator on an input field. I have it working now, however, is there a way to add a validation without attaching it to an input field?

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

Sidebar

Related Questions

I have used http://bassistance.de/jquery-plugins/jquery-plugin-validation/ my form validate : $(#form_person).validate({ rules: { username: { required:
I have an aspx page where I have used jquery validator in a different
jQuery Validation plugin is used to validate all form data: http://docs.jquery.com/Plugins/Validation Have 3 select
I have used JQuery for a small animation work: a table #photos contains 9
I have used JQuery within my asp.net page. JQuery is working fine. I could
I am working on some website , i have used jQuery UI , for
I have not used jquery much yet and not very familiar with it. Trying
can somebody tell me what is jQuery plugin? I have used the jQuery library
I like jQuery and I was wondering if anyone have used a good plugin
I have always used the mouseover event, but while reading the jQuery documentation I

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.