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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T00:23:59+00:00 2026-05-16T00:23:59+00:00

I have a two forms on a page. The first one has several quantity

  • 0

I have a two forms on a page.

The first one has several quantity text boxes that are populated with their respective default values on page load, which can obviously change. Also there may be 1, 2 ,3 or more of these text boxes on the page, so a script would have to account for this. Each text box will have a sequential name of “Quantity1, Quantity2, etc” and the id will be the same as well.

What I want to do it check to see if any of these have been changed from their default value and when either button is clicked on in the second form, it is to do the first form’s button not the second form’s button action.

Now if there were no changes in any of the input text boxes, then the second form’s buttons can and should act as normal. Is this possible and if so a jquery method is preferred?

Note: I stripped out a lot of unnecessary code here so only the relevant stuff is shown.

<form method="POST" name="form" action="ShoppingCart.asp" onsubmit="if (typeof(Update_Hidden_State_Fields)=='function') Update_Hidden_State_Fields(); if (this.submitted) return false; else {this.submitted=true; return true;}">
<td><center><input type="text" maxlength="7" size="5" value="5" name="Quantity1" id="Quantity1"><center></td>
<td><center><input type="text" maxlength="7" size="5" value="2" name="Quantity2" id="Quantity2"><center></td> 
<td><center><input type="text" maxlength="7" size="5" value="5" name="Quantity3" id="Quantity3"><center></td>
<td width="135" align="right"><input border="0" type="image" id="btnRecalculate" name="btnRecalculate" src="v/vspfiles/templates/100/images/buttons/btn_recalculate.gif" alt="Recalculate Totals"></td>

Here is the form that when either button inside it is clicked on and any of the input boxes in the above forms have changed to do the first forms button action.

<form name="Proceed_To_Checkout_Form" method="post" action="https://www.dothisurl.com/login.asp">
<td><input type="image" src="v/vspfiles/templates/100/images/buttons/btn_checkout_guest.gif" name="btn_checkout_guest"></td>
<td><input type="image" src="v/vspfiles/templates/100/images/buttons/btn_checkout_guest.gif" name="btn_checkout_guest"></td>

  • 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-16T00:23:59+00:00Added an answer on May 16, 2026 at 12:23 am

    I’ll make a try :

    $(function(){
      $("[id^='Quantity']").each(function(){
        $(this).data('default', $(this).val());
      });
    
      $("[name='Proceed_To_Checkout_Form']").submit(function(){
        var hasChanged = false;
        $("[id^='Quantity']").each(function(){
          if($(this).val() != $(this).data('default')){
            hasChanged = true;
          }
        });
        if(hasChanged){
          $("#btnRecalculate").click();
          return false;
        }
      });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two forms on one page and want to have the input boxes
I have a Django project that, on one page, has multiple forms (in different
I have two forms, and so two different submit buttons, for one page (page
I have three pages that has forms on them. They all lead to one
I have a database that has two tables, one of which contains a foreign
I have two tables on my page and they appear side-by-side. The first one
I have two forms on one page: a results form and a search form.
I have a web page with 3 web forms, where the first two expect
I have two forms on a page (one is being grabbed by AJAX). I
I have two list boxes. One is populated on Page_Load and the other remains

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.