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

I'm trying to create an RMA form and I have everything working except the
Have a SomeLib.pro file that contains: CONFIG += debug TEMPLATE = lib TARGET =
Have a matrix report now that has Position, Hours and Wages for a location
have not tested on windows. but in ubuntu when u disconnect from the network,
Have converted devise new session from erb to Haml but doens't work, this is
Have searched the database but need to specifically sum(of hours flown or days off)in
Have a bunch of WCF REST services hosted on Azure that access a SQL
have been trying couple of hours now to make my iphone app universal. The
Have a look at one of my websites: moskah.com The problem is that it
Have a simple contact us XPage created. Have server side validation in place that

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.