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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T08:42:16+00:00 2026-06-12T08:42:16+00:00

I have the following list that is dynamically generated. I would like the ability

  • 0

I have the following list that is dynamically generated. I would like the ability to do some Simple Jquery validation if the qty input for a product is less than the qty available, I would like to alert the user. The event I would like to use would most likely be the .change() event because I want the validation to occur before the user attempts to submit the form. The problem I’m having is I need a catch all solution since the id’s are dynamically driven. Not sure where to start.

<ul>
  <li>
    <input class="shipment_qty_field" id="qty_product_1" type="text" />
  </li>
  <li></li>
  <li></li>
  <li id ="avail_qty_product_1></li>
</ul>
<ul>
  <li>
    <input class="shipment_qty_field" id="qty_product_2" type="text" />
  </li>
  <li></li>
  <li></li>
  <li id="avail_qty_product_2"></li>
</ul>   
<ul>
  <li>
    <input class="shipment_qty_field" id="qty_product_3" type="text" />
  </li>
  <li></li>
  <li></li>
  <li id="avail_qty_product_3"></li>
</ul>
  • 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-12T08:42:18+00:00Added an answer on June 12, 2026 at 8:42 am

    Take all your li’s with id = “avail_qty_product_xx” and stick the value in the li that holds the input tag as an ‘data-qty’ such as:

      <li class="qty_container" data-qty="3">
        <input class="shipment_qty_field" type="text" />
      </li>
    

    Then you can add a change handler for the li

    $('li.qty_container input').change(function() {
      threshold = parseInt($(this).closest('li').data('qty'))
       if(parseInt($(this).val()) > threshold) {
          alert('threshold exceeded!')
       }
    })
    

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

Sidebar

Related Questions

I have a list of divs that are dynamically generated and looks like the
I have a drop down list that is dynamically generated using a mySQL database
I have multiple sortable lists that are dynamically generated from a list in MySQL.
I have the following list of time zones that a user can choose from,
I'm trying to solve the following problem in Redis. I have a list that
I have the following SP that I am using to paginate a list of
Given that I have the following WCF service: class LookUpService { public List<County> GetCounties(string
Consider following scenario: I have RESTful URL /articles that returns list of articles user
I have a view that renders a list elements using the following template :
I am trying to build a dynamically generated unordered list in the following format

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.