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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T22:46:37+00:00 2026-06-11T22:46:37+00:00

I am using jQuery validation plugin and have defined a form validation function as

  • 0

I am using jQuery validation plugin and have defined a form validation function as shown below. Based on some user action I am running a custom JS function and in that function I just want to check whether the email and phone fields are valid. But I don’t want to validate them i.e. I don’t want to show the validation errors, I just need to check if their value is valid.

Something like

$('#email').isvalid();

I have checked out the element method of Validator but that validates the element rather than just checking if it’s value is valid. So In other words I am looking for a way to run the rules programmatically. Any help is appreciated!

Form validator function below:

var validator = $("#olForm").validate({
    rules: {
        "email": {
             required: true,
             email: true
        },
        "phone": {
             required: true,
             digits: true,
             minlength: 9,
             maxlength: 11
        }
    }
});
  • 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-11T22:46:38+00:00Added an answer on June 11, 2026 at 10:46 pm

    In response to the original jsfiddle, please see this version:

    http://jsfiddle.net/33PGQ/23/

    This is modified in three ways: firstly, at the bottom, a simple boolean value is set to equal whether both fields are valid (it’s then alerted). As each valid() call returns a boolean value, you can simply and easily check the validity of all form elements.

    Secondly, the validate option is expanded with a custom showErrors function that has no internal code. This function overrides the default behaviour for the validation errors, so that while the internal validity of the fields can be checked and the validity of the fields is handled, no actual error text is displayed, thereby enabling all the validation rules but eliminating the display of the validation results.

    Lastly, though it isn’t explicitly requested in the initial question, I added the optional “onsubmit:false” setting, which overrides the validate call’s default behaviour of preventing form submission unless all validation rules are successfully checked. This can be removed if you want to prevent submission (I assume you would), but I think it’s a useful feature to be aware of. I included it here in case you had a special case where you would want the form to submit even if the form’s validation had failed.

    It’s definitely worth reviewing the options list for validate; there are many ways you can adjust the validator’s behaviour to suit exactly what you want.

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

Sidebar

Related Questions

I am using jquery validation plugin for form validation. I have added a custom
I am using jquery validation plugin to validate my form. I have one field
I have a form using jquery validation plugin. My submit button has an ajax
I'm using the jQuery Validation plugin on my forms. I have some groups of
I'm using the jQuery Validation Plugin on my form. On my form I have
I am using the jquery validation plugin to validate a form. I have the
I am using jquery validation plugin and zend framework. I have my form in
I am using JQuery validation plugin to validate my form. I have a radio
I have a form that validates using the jQuery plugin: Validation, v1.9.0. The validation
I am using jQuery Validation Plugin (http://bassistance.de/jquery-plugins/jquery-plugin-validation/) I have wrote following rule jQuery.validator.addMethod(valueNotEquals, function(value,

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.