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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T20:04:37+00:00 2026-06-12T20:04:37+00:00

I have a dynamic list of textboxes to capture one or more currency amounts.

  • 0

I have a dynamic list of textboxes to capture one or more currency amounts.
I want at least one of the textboxes to have a valid currency amount.

I can’t get it to quite work. I would really appreciate any ideas or suggestions.

Here is what I have so far…

<html>
  <head>
  <script type="text/javascript" src="http://code.jquery.com/jquery-1.8.0.js"></script>
  <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.23/themes/cupertino/jquery-ui.css" rel="stylesheet" type="text/css" />
  <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jqueryui/1.8.23/jquery-ui.min.js"></script>
  <script type="text/ecmascript" src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.10.0/jquery.validate.min.js"></script>
  <script type="text/ecmascript" src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.10.0/additional-methods.min.js"></script>
  <script type="text/javascript" src="js/jquery.maskedinput-1.3.min.js"></script> 

  <div id="page_wrap"><form action="http://local.host.com/myform/net/send" method="post" accept-charset="utf-8" id="myform">
  <h2>Test</h2>
  <h3>Enter an amount and click send</h3>
  <?php //foreach ($recs as $rec): ?>
  <Fieldset>
    <label for="Amount_1">Amount</label>
    <input name="Amount_1" type="text" id="Amount_1" />
  </Fieldset>
  <Fieldset>
    <label for="Amount_2">Amount</label>
    <input name="Amount_2" type="text" id="Amount_2" />
  </Fieldset>
  <Fieldset>
    <label for="Amount_3">Amount</label>
    <input name="Amount_3" type="text" id="Amount_3" />
  </Fieldset>
  <?php // endforeach; ?>

  <span class="button right"><input type="submit" value="Send" /></span>
  <br class="flt_clear" />
  </form>
    <script>
    $(document).ready(function() {
      $('input[name^="Amount_"]').mask("$?999");    
      $.validator.addMethod("pickAtLeastOne", function(value, element, param) {
        return $('input[name^="Amount_"]').val() == "$";
      });
      $('#myform').validate();
      $('input[name^="Amount_"]').each(function() {
      $(this).rules("add", {
        pickAtLeastOne: true,
        messages: {
          pickAtLeastOne: "Please enter at least one amount"
        }
      });
    });
    });
    </script>
  </body>
</html>
  • 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-12T20:04:38+00:00Added an answer on June 12, 2026 at 8:04 pm

    Here is how I got it to work. Everything was correct except my pickAtLeastOne method. Here is the working one:

    $.validator.addMethod("pickAtLeastOne", function(value, element, param) {
      var retCode = false;
      $('input[name^="Amount_"]').each(function(value, element) {
        if ($(this).val() != '$' && $(this).val() != '') {
          retCode = true;
          return;
        }
      });
      return retCode;
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a dynamic list of referrers, example ANN, BOB, ..., ZED. I want
I have a small function that takes a dynamic list of textboxes with urls
I have a list which contains dynamic data. i.e list[0].id=0; list[1].id=1; list[2].id=2; I want
I have a problem to get the highest Value in a dynamic List of
I have a dynamic list code that works just fine. My only problem now
I have a dynamic list of items that will be used to POST information
I have a dynamic ul list from a database being outputted as categories however
I have created a dynamic list picker script using Jquery 1.3 and PHP that
I have created an editor template for representing selecting from a dynamic dropdown list
I need a city/state/country Dynamic Drop-Down List in my Wordpress registration page. I have

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.