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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T15:36:58+00:00 2026-06-05T15:36:58+00:00

I am fully prepared to admit that I am missing something simple here. I

  • 0

I am fully prepared to admit that I am missing something simple here. I find that the documentation on the jquery docs page does not really hold all the information needed to make even basic custom validation.

My problem is I need to validate data that isn’t contained within an element so I’ve been using a sort of ‘dummy’ element to try and trigger my custom method.

<div id="modal-dialog-overlay">
<div id="modal-background"></div>
<article id="dialog-form" class="event-module module">
    <header>
        <h6>New Event</h6>
        <section class="module-actions">
            <span class="button" onclick="overlay_select('modal-dialog-overlay', true);">Cancel</span>
            <span class="primary button" onclick="createBEvent()">Create Event</span>
        </section>
    </header>
    <section class="wrapper">
        @using (Html.BeginForm("CreateEvent", "Conversations", FormMethod.Post, new { enctype = "multipart/form-data", id = "createEventForm", @class = "group" }))
        {
            <input id="participantsChecker" type="text" />
            <input class="submit" type="submit" value="Submit"/>
        }
    </section>
</article>
</div>
</div>

And then the javascript bits are

    $.validator.addMethod("checkParticipants", function (value, element) {
        alert($(".event-module .contact-handle [name='Key']").length);
        return $(".event-module .contact-handle [name='Key']").length
    }, "You need to invite at least one person.");
    $("#createEventForm").validate({
        rules: {
            participantsChecker: {
                checkParticipants: true
            }
        }
    });

Which is in the document.onready for the page.
There’s other code on the page that adds the elements that that selector is looking for and those are definitely there. In any case, that alert never appears when the form is submitted. I was testing it by just hitting submit without entering anything at all into the form.

  • 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-05T15:37:01+00:00Added an answer on June 5, 2026 at 3:37 pm

    input elements must have a name and that’s how jQuery Validate interacts with them:

    <input id="participantsChecker" name="participantsChecker" type="text" />
    

    That should work.

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

Sidebar

Related Questions

Does anybody know a fully featured refactoring tool for C++ that works reliably with
I fully appreciate the atomicity that the Threading.Interlocked class provides; I don't understand, though,
I'm not fully getting all i want from Google analytics so I'm making my
i do not fully understand how to communicate between adobe air (using flex3) and
We're working on a product that may or may not have differing license schema
I have a form that is submitted to a php script with jquery and
I have a very general question and have prepared a simple test case. When
On an older server I'm using that I can't use prepared statements on I
I am prepared to be humiliated on this, but I am not sure what
I know that similar questions were already asked, but still I do not see

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.