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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T18:05:16+00:00 2026-06-02T18:05:16+00:00

I have a web application in which I have used jQuery validation engine for

  • 0

I have a web application in which I have used jQuery validation engine for the client side validations.
This application maintains the record for which user have to enter some ID basically a number.
I maintain an array of all the serial number that users enter.

Now I want a validation on the form, that the value of ID enter by user should be already entered, means should not be in array.

egs: ids = {1,2,3,6,8}, Now next value of ID cannot be the values from the array ids. I want to write such rule in validation engine.

var validator = $("#formId").validate({ 
        rules: { 
            uniqueId: <Rule to write here ???>, 
        }, 
        messages: { 
            uniqueId: "Entered ID already exists", 

        }, 
    }); 

Kindly help me out. Also if anyone has some link of tutorials or something from where I can learn all the possible validation rule implementations… that would be great.

Thanks in advance.

  • 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-02T18:05:17+00:00Added an answer on June 2, 2026 at 6:05 pm

    I’ve never worked with jQuery validation, but this should get you started.
    First create the validation function

    function validateID(value, element) {
        if(ids.indexOf(value) > -1) {
            //value does exist in ids
        }
        else {
           //value does not exist in ids
           //(maybe add it to ids?)
        }
    }
    

    Then add it to the jquery validation rules:

    $.validator.addMethod("idRule", validateID, "message");
    

    And create a rule:

    var validator = $("#formId").validate({ 
        rules: { 
            uniqueId: { 
                idRule: true
            } 
        }, 
        messages: { 
            uniqueId: "Entered ID already exists", 
    
        }, 
    }); 
    

    Here’s a blog post where I found much of this information, you may find it useful too

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

Sidebar

Related Questions

I have a web-application written on ASP.NET MVC 3. On client side I used
I have a web-based application which is very highly reliant on jquery / javascript,
I have a web application in which a user has to upload images to
I have a web application which is used by lots of non-technical users. I
I have a web application which uses membership and profiles. I successfully used the
I have a web application which uses URLs that look like this: http://library.example.com/Register.aspx?query=academic&key=586c70bb-5683-419c-aae9-e596af9ab66a (The
In a nutshell, I have a web application which used to be able to
I have a fairly standard ASP.Net web application which is used via mobile safari
I have used threading in my web application which I have mentioned below: var
I have a web application which basically process entries of the user when the

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.