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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T22:23:53+00:00 2026-06-01T22:23:53+00:00

I’m using the jQuery form wizard plugin. I have 20 questions that each have

  • 0

I’m using the jQuery form wizard plugin. I have 20 questions that each have three answers. Each answer can have a weight. For each question, the total weight of the answers must be equal to 10.

<fieldset id="first" class="step">
    <input type="text" size="2" maxlength="2" value="" name="question1[]" class="required"/>A: Inspiring others with a compelling vision for change.<br />
    <input type="text" size="2" maxlength="2" value="" name="question1[]" />B: Engaging others to buy-into the change.<br />
    <input type="text" size="2" maxlength="2" value="" name="question1[]" />C: Executing a project plan and managing accountabilities.<br />
    <label for="question1[]" class="error" style="display:none;">Your values must add up to 10!</label>
</fieldset>

This is basically a personality assessment. Let’s say I feel A and C do not apply, I’d enter in 10 for A.

Is there any way to check to see if each field set is adding up to 10 and if not send an error message?

I am using the jQuery validation plugin, but this seems to be a bit too specific, as I know it checks for numbers, etc.

I’ve tried to add something along the following to even get a required check to pass, but I’m not sure where to go from here:

$(document).ready(function() {
    $("#Form").validate({
        submitHandler: function(form) {
            form.submit();
        }
    });
    $("#Form input[name='question1']").each(function() {
        $(this).rules("add", {
            required: true,
            maxlength: 2,
            messages: {
                required: "Required",
                minlength: jQuery.format("Max length of {2} characters.")
            }
        });
    });
});

I have also found that jQuery validate had to have a function edited to accomodate arrays. I’ve changed the following function:

checkForm: function() {
    this.prepareForm();
    for (var i=0, elements=(this.currentElements = this.elements()); elements[i]; i++ ) {
        if (this.findByName(elements[i].name).length != undefined &&
            this.findByName( elements[i].name ).length > 1) {

            for (var cnt = 0; cnt < this.findByName( elements[i].name ).length; cnt++) {
                this.check( this.findByName( elements[i].name )[cnt] );
            }
        }
        else {
            this.check( elements[i] );
        }
    }
    return this.valid();
}

I have also tried this:

$(document).ready(function(){
    $("#Form").validate({
        rules: {
            question1: {
                required: true
            }
        },
        submitHandler: function(form) {
            form.submit();
        }
    });
});

None of this seems to work to even give me a ‘required’ error. There are no errors in console. I need to validate this on each question as the “next” button is pressed. The next button does have type=submit, so it theoretically should at least see that I said question 1 must be required but to no avail.

I also tried this:

$().ready(function() {
    // validate the comment form when it is submitted
    $("#Form").validate({
        rules: {
            "question1[]": "required"
        },
        messages: {
            "question1[]": "Input is required",
        }
    });
});

But it goes on to the next fieldset with no error.

  • 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-01T22:23:55+00:00Added an answer on June 1, 2026 at 10:23 pm

    In this case, create a new input that’s disabled, and when the individual weight values change, change the value of this disabled input to be the sum. Validate the disabled input – require it’s value be equal to 10, and if it’s not, show an error.

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

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am reading a book about Javascript and jQuery and using one of the
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a text area in my form which accepts all possible characters from
I have thousands of HTML files to process using Groovy/Java and I need to
link Im having trouble converting the html entites into html characters, (&# 8217;) i

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.