javascript - total of dynamic input -
Hello I have 3 types of input Dynamic I create with an add button
// Function Appendix Merry Works CounterMardi = 0; Var $ newRow; Click on $ (Function () {$ ('# add_mardi') (function () {countermardi + = 1; $ $ NewRow = $ ('& lt; Input ID = "nummar' + countermardi + '" name = " Nummer [] '+' "type =" text "onblur =" autre (); "onfocus =" enter (); "/>;); $ ('# nummar'). Attachments ($ newRow) $ NewRow.keypress (function (e) {return handledynmar (event, this' work ');}) $ newRow.autocomplete (autocompOpt);. $ (' # Clientmar ') enclosed ((' & lt; input id = "clientmar '+ Countermardi +' "name =" customer [] '+' "type =" text "onblur =" autre (); "onfocus =" enter (); "/ & gt; ')) $ (' # prodescmar '). Append ((' & lt; input id = "prodescmar '+ countermardi +'" name = "prodescmar [] '+'" type = "text" onBlur = "sub Access to categories (); "onFocus =" login (); "/>) '$' ('#protector'). App (('' '.) Attached ((' ')) $ (' # prolieudivmar & lt; input id = "prolieudivmar '+ Countermardi +' "name =" prolieudivmar [] '+' "type =" text "onBlur =" access to sub-categories (); "onFocus =" login (); "/> ')) = $ (Selection' & lt; selection id = "tachedivmar '+ countermardi +'" name = "tachedivmar []" type = "text" onblur = "autre ();" onfocus = "enter ();" /> '); Select.append ($ ("# selectmardi Options") .clone ()); Add $ ("#Tachedivmar") (select) .; $ ('# CalculTempsdivmar'). The app (('> id = "calculTempsdivmar' + countermardi + '" name = "calculTempsdivmar []' + '" type = "number" size = "10" min = "0" max = "24" value = "0" square = "dynamic" onblur = "autre ();" onfocus = "enter ();" /> gt; '))}); });
I have the calculation of X input for a total of 1 day.
& lt; Td> & Lt; Span id = "calculTemps2" & gt; & Lt; Div id = "calculTempsdivmar" & gt; & Lt; Input stage = "any" id = "temps3" onblur = "autre ();" OnFocus = "login ();" Type = "number" square = "temps" name = "tempsma" size = "2" min = "0" max = "24" value = "0" /> gt; & Lt; / Br & gt; & Lt; / Div & gt; & Lt; / Span & gt; & Lt; / TD & gt; & Lt; TD & gt; & Lt; Div id = "tempsmartotal" & gt; & Lt; Input stage = "any" type = "text" onblur = "autre ();" OnFocus = "login ();" Id = "tempsmartotal" class = "temps" name = "tempsmartotal" size = "5" value = "0" /> gt; & Lt; Br / & gt; & Lt; / Div & gt; & Lt; / TD & gt; & Lt; / TR & gt;
and I have total time
How can I make a calculator in a steady way here
// mercredi $ ("# calculTemps3"). ('Change', 'input .temps', function () {var total = 0; $ (". Temps"). (Function () {total = parseFloat (total) + parseFloat ($ (this) .val ());}); $ ("#parent"). Val (total);});
So how do I calculate for my new calculTempsdivmar thurdays?
use length
$ ("# calculTemps3") . ('Blur', 'input.temps', function () {var total = $ (this) .book ('input') Length; $ ("# result"). Val (total);});
Comments
Post a Comment