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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T12:03:48+00:00 2026-05-31T12:03:48+00:00

Basic form using a JQuery Accordion and attempting to validate required fields. Am I

  • 0

Basic form using a JQuery Accordion and attempting to validate required fields. Am I missing something simple? Thanks!

javascript:

<script type="text/javascript" language="javascript">
    $(document).ready(function () {
        $("#accordion").accordion();
        $("#Form1").validate({
            rules: {
                AccordionField: { required: true }
            }
        });
    });    
</script>

html:

<form id="Form1" action="foo.htm">
    <div id="accordion">
    <h3><a href="#">Section 1</a></h3>
    <div><p>content</p></div>
    <h3><a href="#">Section 2</a></h3>
    <div><p><input id="AccordionField" class="required" /></p></div>
    </div>
    <p><button type="submit">Submit</button></p>
</form>

Problem:
If the second section is collapsed during the submit, validation does not validate the required field.

  • 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-31T12:03:49+00:00Added an answer on May 31, 2026 at 12:03 pm

    jQuery validate (1.9) ignores hidden fields by default. You can override this behavior using the ignore option:

    $(document).ready(function() {
        $("#accordion").accordion();
        $("#Form1").validate({
            rules: {
                AccordionField: {
                    required: true
                }
            },
            ignore: []
        });
    });​
    

    Example: http://jsfiddle.net/andrewwhitaker/VWWkP/

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

Sidebar

Related Questions

I’m using jQuery Validate for my site’s contact form. The input fields have pre-populated
I am using the jQuery validation plugin on my form. I set the basic
I'm trying to build a basic contact form using jQuery. The markup is essentially
Html form is controlled using Knockout JS and jQuery templates. Basic jQuery validation is
I've got a simple Listbox on a HTML form and this very basic jQuery
i have very simple basic form in HTML and i want to validate the
I'm creating a basic form with ajax submit using jquery framework. This is my
I have a basic HTML form that I am centering. I am using jQuery
Something strange is happening here. I have a basic form: <% using (Html.BeginForm()) {
I am learning jQuery right now and am looking to validate form fields with

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.