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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T06:36:08+00:00 2026-06-03T06:36:08+00:00

I have two hidden input fields on my form that I have linked to

  • 0

I have two hidden input fields on my form that I have linked to jquery validation rules. These are sort of “global” form rules (for example the total of multiple fields not equal to 100%), so I am using hidden fields at the top of my form to show a message that applies to the whole form.

They are defined like this:

<input type="hidden" class="futuretotalsunder"/>
<input type="hidden" class="futuretotalsrequired"/>

Here are my rule definitions. You can get the idea of it. The first rule checks to see if a bunch of text boxes total up to < 100, and the second check to make sure the total isn’t 0. The problem is, the only one that fires is whichever one is applies to the first hidden input element. The second one never fires. Any idea why?

$.validator.addMethod("futuretotalsunder", function (val, element, params) {
        alert("under");
        var total = 0;

        $(".TransferPercentTextBox").each(function () {
            total = total + parseInt($(this).val());
        });

        if ((total < 100) && (total != 0)) {
            window.location.href = "#Top";
            return false;
        }
        else {
            return true;
        }
    }, "Total percentage must equal 100%.");

     $.validator.addMethod("futuretotalsrequired", function (val, element, params) {

        var total = 0;

        $(".TransferPercentTextBox").each(function () {
            total = total + parseInt($(this).val());
        });

        if (total == 0) {
            window.location.href = "#Top";
            return false;
        }
        else {
            return true;
        }
    }, "Transfer amount must be greater than 0.");
  • 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-03T06:36:09+00:00Added an answer on June 3, 2026 at 6:36 am

    I figured it out. The problem (oddly) was that my input elements didn’t have name attributes. Once I added them it worked fine.

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

Sidebar

Related Questions

I have the following two fields in a form: <input type=button value=Rep id=rep name=rep
I have a form in CakePHP that has two live-search text input. Each one
I currently have two input fields which toggle the value value to either true
I have a PHP form that needs some very simple validation on submit. I'd
I have two form elements on my page that act as a smooth login
hey, well I have this form <form method=POST action=''> <input type=hidden name=op value=download1> <input
I have two submit buttons in one form and both the submit are linked
I have two buttons inside a form call: <% using (Html.BeginForm()) {%> <input type=submit
I have two methods that draw a rotated rectangle on the screen. RenderMethod1 renders
I have two classes that extend the activity class. Each class has it's own

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.