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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T20:13:12+00:00 2026-05-28T20:13:12+00:00

We have a table that has a product record on each row. Each product

  • 0

We have a table that has a product record on each row. Each product may have from zero to 6 dropdowns (we call them option groups) associated with it. If a customer enters a quantity greater than zero I need to make sure they have made a selection from each dropdown (if there is a dropdown for that product). Any ideas? Here’s a sample table and then my jquery code.

<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr class="GroupRow">
  <td valign="top"><strong>
    <input name="ItemQty1" type="text" id="ItemQty1" class="ItemQuantity" value="1" size="4" maxlength="3" style="width:20px;" />
    </strong></td>
  <td valign="top">&nbsp;</td>
  <td valign="top"><strong>Arctic Armor Suit Black Suit </strong>
    <div id="pd-optionsContainer_1" style="margin-bottom:20px;">Jacket Size:&nbsp;
      <select name="OptionID_1" id="ParentID_1" class="OptionsSelected">
        <option value="">Select</option>
        <option value="11053">Medium</option>
        <option value="10543">Large</option>
        <option value="13751">X-Large</option>
        <option value="7300">2X-Large</option>
        <option value="7696">3X-Large</option>
      </select>
      &nbsp;&nbsp;

      Bib Size:&nbsp;
      <select name="OptionID_2" id="ParentID_2" class="OptionsSelected">
        <option value="">Select</option>
        <option value="11052">Medium</option>
        <option value="10542">Large</option>
        <option value="13750">X-Large</option>
        <option value="7310">2X-Large</option>
        <option value="7703">3X-Large</option>
      </select>
      &nbsp;&nbsp;

      Glove Size:&nbsp;
      <select name="OptionID_3" id="ParentID_3" class="OptionsSelected">
        <option value="">Select</option>
        <option value="11054">Medium</option>
        <option value="10517">Large</option>
        <option value="13737">X-Large</option>
        <option value="7295">2X-Large</option>
      </select>
      &nbsp;&nbsp; </div></td>
  <td valign="top"><strong>$329.99</strong></td>
</tr>
<tr class="GroupRow">
  <td valign="top"><input name="ItemQty2" type="text" id="ItemQty2" class="ItemQuantity" value="0" size="4" maxlength="3" style="width:20px;" /></td>
  <td valign="top">&nbsp;</td>
  <td valign="top">Arctic Armor Gloves
    <div id="pd-optionsContainer_2" style="margin-bottom:20px;">Size:&nbsp;
      <select name="OptionID_4" id="ParentID_4" class="OptionsSelected">
        <option value="">Select</option>
        <option value="11056">Medium</option>
        <option value="10519">Large</option>
        <option value="13739">X-Large</option>
        <option value="7297">2X-Large</option>
      </select>
      &nbsp;&nbsp; </div></td>
  <td valign="top">$29.99 </td>
</tr>
</table>



    $('tr.GroupRow input.ItemQuantity').each(function(index) {
        if ($(this).val() > 0){
            alert(index + ': ' + $(this).val());
            $('tr.GroupRow').find('select.OptionsSelected').each(function(index) {
                //if ($(this).val() > 0){
                    alert(index + ': ' + $(this).val());
                //}
            });
        }
    });
  • 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-28T20:13:13+00:00Added an answer on May 28, 2026 at 8:13 pm

    Working jsFiddle.net example. Fun problem to solve. Thanks. 🙂

    <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr class="GroupRow">
      <td valign="top"><strong>
        <input name="ItemQty1" type="text" id="ItemQty1" class="ItemQuantity" value="1" size="4" maxlength="3" style="width:20px;" />
        </strong></td>
      <td valign="top">&nbsp;</td>
      <td valign="top"><strong>Arctic Armor Suit Black Suit </strong>
        <div id="pd-optionsContainer_1" style="margin-bottom:20px;">Jacket Size:&nbsp;
          <select name="OptionID_1" id="ParentID_1" class="OptionsSelected">
            <option value="">Select</option>
            <option value="11053">Medium</option>
            <option value="10543" selected>Large</option>
            <option value="13751">X-Large</option>
            <option value="7300">2X-Large</option>
            <option value="7696">3X-Large</option>
          </select>
          &nbsp;&nbsp;
    
          Bib Size:&nbsp;
          <select name="OptionID_2" id="ParentID_2" class="OptionsSelected">
            <option value="">Select</option>
            <option value="11052">Medium</option>
            <option value="10542">Large</option>
            <option value="13750">X-Large</option>
            <option value="7310">2X-Large</option>
            <option value="7703">3X-Large</option>
          </select>
          &nbsp;&nbsp;
    
      Glove Size:&nbsp;
      <select name="OptionID_3" id="ParentID_3" class="OptionsSelected">
        <option value="">Select</option>
        <option value="11054">Medium</option>
        <option value="10517">Large</option>
        <option value="13737">X-Large</option>
        <option value="7295">2X-Large</option>
      </select>
      &nbsp;&nbsp; </div></td>
      <td valign="top"><strong>$329.99</strong></td>
    </tr>
    <tr class="GroupRow">
      <td valign="top"><input name="ItemQty2" type="text" id="ItemQty2" class="ItemQuantity" value="0" size="4" maxlength="3" style="width:20px;" /></td>
      <td valign="top">&nbsp;</td>
      <td valign="top">Arctic Armor Gloves
        <div id="pd-optionsContainer_2" style="margin-bottom:20px;">Size:&nbsp;
          <select name="OptionID_4" id="ParentID_4" class="OptionsSelected">
            <option value="">Select</option>
            <option value="11056">Medium</option>
            <option value="10519">Large</option>
            <option value="13739">X-Large</option>
            <option value="7297">2X-Large</option>
          </select>
          &nbsp;&nbsp; </div></td>
      <td valign="top">$29.99 </td>
    </tr>
    </table>
    
    $('tr.GroupRow').each(function(index, element) {
        if($(element).find('input').val() > 0) {
            alert('row ' + index + ' has a quantity greater than zero');
            $('select', element).each(function(index, element) {
                if($('option:selected', element).val() === '') {
                   alert('option ' + index + ' is not selected!');
                }
            });
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Have a table called user_products that contains a record for each product the user
Which is your preference? Let's say we have a generic Product table that has
I have a table that has a processed_timestamp column -- if a record has
I have a table that has about 1/2 million records in it. Each month
I have a table that has three different date columns, so I set each
I have a product table with a tag column, each product has multiple tags
I have a SQL Server DB that has a table of products, and another
I have a table that has redundant data and I'm trying to identify all
I have a table that has an insert trigger on it. If I insert
I have a table that has a primary key that's an INT... 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.