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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T18:13:21+00:00 2026-05-21T18:13:21+00:00

I have an accordion JQuery UI control that shows two different sets of fields.

  • 0

I have an accordion JQuery UI control that shows two different sets of fields. At least one set has to be enabled, and when it is, it needs the validation disabled for the other set. This has been really frustrating to implement dynamically.

Finally I settled on maybe just removing the validation rules right before the submit on the set of fields that are collapsed. (So the user is no required to fill that set). However, even then I can’t seem to figure out how to attach an event to the form’s submit event that will run before the validation! I was this function to run before the JQuery validation. I’m using MVC3. Here’s what some of my code looks like:

<div id="accordion">
            <h3><a href="#">Option Set 1</a></h3>
            <div>
                 [Set of fields here]               
            </div>
            <h3><a href="#">OR Option Set 2</a></h3>
            <div>
                 [Set of fields here]  
            </div>
        </div>
  • 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-21T18:13:22+00:00Added an answer on May 21, 2026 at 6:13 pm

    I’m not familiar with ASP.NET MVC at all, but I am familiar with jQuery (as well as the validate plugin) so here goes.

    I think you need to make all the fields within the containing <div> disabled whenever that part of your form is being rendered. It can be as simple as $("selector for div").find(":input").attr("disabled", true); (you can flip them back on using false instead of true)

    This should work best for 2 reasons.

    1. The jQuery Validate Plugin will skip any disabled elements
    2. Disabled elements are not sent to the server when the form is posted
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have next problem: There is jquery accordion control. One of tab have div
I have a Jquery Accordion and I have a asp.net GridView below that. When
I have a jquery accordion style menu that I'd like to add some shortcut
I have a jquery accordion that I want to use nth-child to assign odd
So basically, I have a jQuery accordion. I arranged the content so that it
I have a jQuery based accordion style navigation that I am trying to modify.
I have the jQuery Accordion set up on a page of mine, and the
Does anyone have a demo of a jQuery accordion that cycles through content automatically
I have the following structure for my jQuery Accordion: <ul id='accordion'> <li class='header'> <a
I have created a jquery plugin to expand/collapse ul,li something like a accordion menu

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.