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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T02:20:37+00:00 2026-05-19T02:20:37+00:00

I have an RMA form that I’ve been able to add fields dynamically, but

  • 0

I have an RMA form that I’ve been able to add fields dynamically, but having trouble it being able to handle events (like click, change).

I’m adding the fields by using the .appendTo("#container"); and incrementing the NAME parameter using a counter, so that when the user hits Submit–I’ll get ‘Category1: blah’ ‘Category2: blahblah’ ‘Category3: something_else’, etc.

The problem is when I add more fields (like a dropdown box) dynamically, the events don’t follow. I have 3 drop downs [category] [subcategory] [model]. When I select a category:

jQuery('#cat').bind("change", function()
    {
        jQuery('#subcat').empty();
        jQuery('#subcat').attr('disabled', 'disabled');
        jQuery('#model').empty();
        jQuery('#model').attr('disabled', 'disabled');

        LoadSeries(jQuery(this).val()); // I do a .removeAttr('disabled'); in here for #subcat

    });

In the above code, I tried adding jQuery('#cat'+counter).bind("change", function() { ... but I think that event will only fire if I change the [category] and hit the add button simultaneously.

I tried using .live but I’m not sure how to get it to work with added elements with different class/name parameters (cat2, cat3, cat4, cat5…)

Would I need separate functions as well? (LoadSeries2, LoadSeries3, etc.) for the amount of fields that are added?

Any suggestions appreciated.

EDIT: Some of the HTML code to show radio buttons above the [category] [subcategory] [model] drop downs. This is for the user to select whether it’s going to be a return or an exchange.

    newTextBoxDiv.after().html('
    <div class="item'+counter+'"><br/>
    <table width="820" border=1 cellspacing="0" cellpadding="0" align="center" style="border: 1px; border-color: #000;">
      <tr>
         <td>
            <div align="center" style="font-size: 14px;">
            <input type="radio" class="radioBtn'+counter+'" name="Return_Exchange'+counter+'" value="Return" selected="selected">Return
            <input type="radio" class="radioBtn'+counter+'" name="Return_Exchange'+counter+'" value="Exchange">Exchange</div>
...
  • 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-19T02:20:38+00:00Added an answer on May 19, 2026 at 2:20 am

    you can use the live() method or in your case the delegate() method might be best. Combined with the starts-with selector (^=) you should be good to go…

    $("#container").delegate("[id^='cat']", "change", function() {
        $("#subcat, #model").empty().attr("disabled", true);
        LoadSeries($(this).val());
    });
    

    jQuery using on

    $("#container").on("change", "[id^='cat']", function() {
        $("#subcat, #model").empty().attr("disabled", true);
        LoadSeries($(this).val());
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

have a table that dynamically generates text boxes in run time. I want to
I have a simple problem but no matter what I try I can't see
I apologize in advance, I am a PHP noob! I have form with some
I have a model that is something like this: class ReturnAuthorization(models.Model): custom_id = models.CharField(max_length=40)
I have an ASP.NET application that is fairly basic. It queries some data and
Have noticed issue while testing iphone app that if one quickly opens/dismisses a modal
Have a build process that can't be edited and need to pack another war
I have a project that adds elements to an AutoCad drawing. I noticed that
I have a script that appends some rows to a table. One of the
I have a new web app that is packaged as a WAR as part

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.