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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T22:11:46+00:00 2026-05-15T22:11:46+00:00

I have done some small validation myself and end up with either – myvalid

  • 0

I have done some small validation myself and end up with either – myvalid = true or mayvalid = false. How can add this check to the validation I am doing already on my form using the Validation Plugin?

  • 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-15T22:11:47+00:00Added an answer on May 15, 2026 at 10:11 pm

    You can use .addMethod() to add custom validation methods to the Validation plugin.

    http://docs.jquery.com/Plugins/Validation/Validator/addMethod#namemethodmessage


    Update:

    Here’s an example you can test: http://jsfiddle.net/W8EsU/

    HTML

    <form id='theForm'>
        <input id='test_field' name='test_field' value='jQuery' />
        <br>
        <input id='test_field2' name='test_field2' value='prototypejs' />
    </form>​
    

    jQuery

       // Add a validation method to the validator plugin
       //    that can be applied as a rule to whatever fields
       //    you want. That way you get your custom validation
       //    integrated into the functionality of the plugin
    $.validator.addMethod(
        "mustIncludejQuery", 
        function(value, element) { 
            return value.toLowerCase().indexOf('jquery') > -1;
        }, 
        "You must type jQuery to be valid."
    );
    
        // Apply the custom validation to the fields
    $('#theForm').validate({
       rules: {
           test_field:'mustIncludejQuery',
           test_field2:'mustIncludejQuery'
       }
    });
    
        // Demonstrates that they will be executed
        //    like any other validation rule.
    $('#theForm').valid();
    ​
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some small project to stream video to android device. Streaming is done
I have a small application where there are some reports i have done. What
Well. I have done a small project. But the problem is some of my
Have done some research and found some stuff that may be helpful. I would
I have done some research, and majority of the examples I have found use
I have done some research on the above and found that I am able
i have done some code in jquery but where i commented in this bellow
i have done some learning on struts based on one project that i got.Now
I am starting a new project for a client today. I have done some
I am researching UDID alternatives, and OpenUDID seems interesting. I have done some testing

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.