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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T08:39:47+00:00 2026-06-18T08:39:47+00:00

I am using jQuery validate plugin to do custom validations on my forms. For

  • 0

I am using jQuery validate plugin to do custom validations on my forms. For one particular type of form, the user has the option to submit the form, or they can also save the form without submitting. I was able to use $('form.validate').validate().cancelSubmit = true; to suppress validation in the onClick handler for the save button, and life was good.

However, one of the custom validations that was written enforces that people must enter legit characters (i.e. it enforces that you use valid ascii characters). I want to continue to enforce the ascii validation, because if I don’t, people are able to save bad data to the database (which subsequently messes up integrations we have running).

Basically I want to enforce all rules except required: true. I see that you can use the ignore option when setting up the validation on the form $('form.validate').validate({ignore : ".required"}); but this only seems to work when you are initially setting up the validation. When I try to do that when a user clicks the button, it doesn’t seem to do anything.

I’ve seen some posts about similar things but usually related to ignoring hidden fields. Does anybody know the correct syntax / method I need to use to ignore the required rule upon button click? Any help would be appreciated.

  • 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-18T08:39:49+00:00Added an answer on June 18, 2026 at 8:39 am

    You could use the rules('remove') method to remove your rules dynamically. Something like this on your “save” button.

    $('#save').click(function () {
        $('#myform').find('.myclass').each(function () {
            $(this).rules('remove', 'required');
        });
        // your code to save form
    });
    

    Demo: http://jsfiddle.net/NqT2V/

    Important NOTE: As per rules('remove') documentation, “Manipulates only rules specified via rules-option or via rules('add').” In other words, this will not work if your rules are added inline via class="required".


    And the rules('add') method to add the rules back just before submit…

    $('#submit').click(function (e) {
        e.preventDefault();
        $('#myform').find('input').each(function () {
            $(this).rules('add', 'required');
        });
        $('#myform').submit();
    });
    

    Demo: http://jsfiddle.net/3G8cN/

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

Sidebar

Related Questions

I'm using the jQuery validate plugin to validate a multi-step form like this one:
I'm using jquery's validator plugin to validate my registration form. I made a custom
I'm using the jQuery.validate plugin to validate inputs for my user registration form. I've
I'm using jQuery Validate plugin and store Error messages in title, e.g.: <input type=text
I'm using the jQuery validate() plugin for some forms and it goes great. The
I am trying to using a jquery.validate.unotrusive.js plugin to dynamically created form fields like:
I'm using the Jquery Validation plugin to validate my form on the client before
I'm try to validate form using jquery validation plugin my from code: source code
I am using jquery-1.4.2 library and jquery.validate.js plugin to validate a very simple form.
I am using jQuery Validate plugin to validate my form, how can i validate

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.