Skip to content Skip to sidebar Skip to footer

Function For Adding New Items

I have an invoice. Line items are arranged in a table, basically like this: | product name (drop down select menu) | price | quantity | line total | I have this JavaScript file: h

Solution 1:

You'll need to attach your events with on() so that dynamically added content is wired up automatically

My firewall is blocking your link, but something like this:

$(document).on("blur", ".someSelector", function() {
   //your handler
});

if you're using jQuery 1.7, or, if you're on an older version of jQuery, you can use delegate

$(document).delegate(".someSelector", "blur", function() {
   //your handler
});

Do not use live, since it's deprecated

Solution 2:

I think you have to make use of live() function.

Attach an event handler for all elements which match the current selector, now and in the future.

Meaning it will be applied on any future control that's being added after setting the event.

Update: Seems like live is deprecated (Although implemented in 1.7 as comments state). So Adam Rackis's answer seems to be more suitable.

Post a Comment for "Function For Adding New Items"