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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:39:56+00:00 2026-05-26T05:39:56+00:00

I have a document with a dynamic UI–users can add rows to an existing

  • 0

I have a document with a dynamic UI–users can add rows to an existing data entry form as needed to provide more information.

I’m using a simple array to track what items are on the screen so I can prompt for save, but I’m having trouble figuring out how to add the ID of the new item to my array. The logic that works for existing items is

$(document).ready(function () {
   $('.monitor').each(function () {
        monitorIds.push($(this).attr('id'));
        monitorValues.push($(this).val());
    });
});

I was hoping to be able to do something along these lines, but can’t find a suitable way to do it: (I’m aware that this doesn’t work, as the ‘live’ method isn’t defined with an event)

$('.monitor').live(function () {
    monitorIds.push($(this).attr('id'));
    monitorValues.push($(this).val());
});

I’ve seen the LiveQuery plug in, but as I’m already deep into plugin hell, was hoping to avoid adding yet another one. Is there a better way?

EDIT: I wasn’t clear about one point–I’m trying to keep this in a separate script, and do it dynamically, rather than update each script that might add elements to also call a function to add the element(s) to the monitoring array. Just trying to keep the work of the team to a minimum to implement this, even after they’ve written scripts to do the UI 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-05-26T05:39:56+00:00Added an answer on May 26, 2026 at 5:39 am

    Due to NodeList being a live collection, we can listen to element additions/removals like this:

    (function(){
    var a = document.getElementsByTagName("*"), elmCount = a.length;
    
        window.setInterval( 
            function(){
            var curCount = a.length;
    
                if(curCount !== elmCount ) {
                jQuery( document ).trigger( "DOMChange" );
                elmCount = curCount;
                }
            },
        200 );
    
    
    })();
    
    jQuery( document ).bind( "DOMChange",
        function(e){
        console.log("domchange");
        }
    );
    

    Downside is that if the DOM changes without the element count changing, it won’t trigger.
    Tested on google chrome 14 on this very page.

    Also, it should be slightly more efficient to do this instead of creating new jQuery objects:

    $('.monitor').each(function () {
            monitorIds.push( this.id );
            monitorValues.push this.value );
        });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a particular requirement to generate a PDF document with some dynamic data
I have a web form which has dynamic table using repeating rows. New rows
can javascript document.write head meta part for seo? I have dynamic pages, so I
I have a dynamic form that can be cloned, using the SheepIt! plugin to
I have a document with headings and unordered lists. How can I use JQuery
I have a document-based Core Data app. My main Core Data entity has several
I have a document with dynamic image and dynamic text and would like the
I have a document library in a sub site. How do I add a
I have a complex form that has a static section and one that can
I have a dynamic HTML document, and in a particular point of time it

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.