Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Run fucntion on table change

Featured Replies

Hey, is there any way to get this:

$(document).on('keyup', "*[data-field='quantity'],*[data-field='price']", function(e){

to run whenever there's a change the whole table?

 

At the moment it only changes on the keyup in the [data-field=quantity] and [data-field=price] as it says. But thing is I have a button to delete a row, and once ones deleted it doesn't update the total. To see what I mean go here:

 

 

http://jsfiddle.net/re2af/195/

 

And add like two rows and watch it add up the totals, then delete one. The total doesn't update until there's another change in the [data-field=quantity] and [data-field=price] inputs.

 

I also have a button which will add prefilled data into this table, so I kind of need that line above to run whenever there's a change in the table.

 

I have tried all sorts (on change, on blur, on click etc...), this came close:

$("#mytable").bind("DOMSubtreeModified", function() {
    alert("Hurrey table changed");
});

As it would alert when there was a change, but I couldn't get it to work with the form in the jsfiddle.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.