jquery help running a keyup event -


I'my text is trying to store values ​​in the box and transfers the total amount in a span tag . I have the right to work (type ...) my problem is that the "keyboard" event is not working on form elements to add after the page is loaded. For example, when the page render, it shows an INPUT box where the user can enter the number. It has an "add" link that will clone in the INPUT box, thus allowing the user to add as many elements as they want. I am using a class attribute to tie all the input boxes together so that I can use jqueries .each () on them.

Here's what the code is doing if I dynamically add 3 or text boxes, then the keyboard event is only implemented on 1 INPUT box which was originally on the page on page ... But when I type the values ​​in this box, the number of dynamically generated input boxes is given as they should be expressed, therefore, it is doing the job properly, even though I have a keyboard from the dynamic input box. I want to start the incident.

I am using jqueries ".after ()" to add elements to the dome

Here is the JQUERY code:

  $ (document) .ready (function () {// INSERT INCOME TOTAL $ ('.' Income_txt \ '). Work () {$ (This) .keyup (function () {calculateSum ('income_total', 'income_txt');})}}}; // and income sum}}; // and document ready  < / Pre> 

Here is the function that is stored in .js file

  // Calculates the calculations function function equals (ele, classname) {var sum = 0; // each Repeat through the text box and add values ​​$ ("." + Classname) .each (function () {// only if add Value is the number (if!) .length! = 0) {sum + = parseFloat (this.value);}}} $ ("#" + elephant) .html (amount); HTML markup:  
  & quot; input class = "income_txt" type = "text" name = " 

}

i_itail1" id = "' $ Property_id. '_income_value_id1' / & gt;

Any thoughts on how to complete?

Thanks for the help.

< P>

When you clone the input, are you adding 'true' to the call? It will also clone events.

  $ ('. MyElement'). Clone (true);  

Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -