Haensl D. Haensl D. - 1 year ago 86
HTML Question

Keep track of changes in html table/form

What I'm trying to achieve is to keep track of any changes (e. g. user input, field added, ...) within a

In my specific scenario users can edit fields, add rows, add fields, remove fields and rows, select something in
-elements, etc.

Of course I could just attach my "change"-listener to all of those actions, but I think there must be a better way.

I tried attaching a
$('#myTable tbody').change()
-listener to it, but that doesn't fire...

Maybe some of you know of a way to keep track of table changes without having to subscribe to every possible user action manually?

Answer Source

To answer my own question:

I decided on doing it kinda like @mdsl suggested:

I now listen for changes like this:

$('#myTable tbody').on('focusout', 'input, select, checkbox', myListener);

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download