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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T00:39:37+00:00 2026-06-03T00:39:37+00:00

I have a form and I’m using the jQuery Table AddRow plugin to dynamically

  • 0

I have a form and I’m using the jQuery Table AddRow plugin to dynamically add rows to a table, the problem is I’m trying to when you select a Menu Item that the menu item goes into the text box to the left of it. It works on the first row but I can’t figure out how to get it to work with rows that are added via the plugin.

You can see my code in action here: http://jsfiddle.net/VXNzd/

Here is the jQuery code:

// This moves the select box text to the input box
$('#mnu_names').change(function() {
    var mnuProduct = $("#mnu_names").find(':selected').text();
    var mnuCleanProduct = mnuProduct.split(' - ');
    $('#topping_name').attr('value', mnuCleanProduct[0]);
});
// This code is needed to add and delete rows with the plugin
$(".toppings_add").btnAddRow({

It may be easier to see what I’m talking about by visiting the jsfiddle link up top. When it loads use the select box to and select something, It will put that info over into the text box without the price info. Add a new row and try it again. Won’t work, can’t figure out how to make it work.

  • 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-03T00:39:39+00:00Added an answer on June 3, 2026 at 12:39 am

    The problem was as said by tomhallam your ID’s are not unique. Also $.change() does not work on blocks added after you ran that. You should instead use $.on('change',...).

    I updated your code and posted it on http://jsfiddle.net/PDPbn/5/.

    The modified jquery-code goes as follows:

    $(document).on('change','.mnu_names',function() {
        var mnuProduct = $(this).find(':selected').text();
        var mnuCleanProduct = mnuProduct.split(' - ');
        $(this).parentsUntil('tbody').find('.topping_name').attr('value', mnuCleanProduct[0]);
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have form, where some fields are looks like rows, so I can add/delete
I have form and form text field which generates dynamically using JSP. And I'm
i have form and i am using jquery validate jquery.validate.pack.js its work fine when
I have form in my page, I am using ajax.beginform(). Inside this form I
I have form like this : <div id='add_field' class='locbutton'><a href='#' title='Add'>Add</a></div> <div id='remove_field' class='locbutton2'><a
I have: form.input :duration, as: select, collection: {} I need: <option value= data-price=XXX></option> Rails
I have form in VB.Net 2010: I want to click-drag multi rows in dgRegister
I have form with input 's. When it's opened (via jQuery UI: Dialog)... cursor
I have form, where user selects Airport and then can select one of airport
I have: form.php preview.php form.php has a form in it with many dynamically created

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.