Jquery简单查询添加了行的所有元素 [英] Jquery simple query addition of all elements of row
本文介绍了Jquery简单查询添加了行的所有元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我为基于行的计算创建了两个jsfiddle,
这里从前一个减去最后两个值。
例如:10 -2-6 = 2
单行它工作正常但我遇到多行问题
1:单行正常工作
http://jsfiddle.net/mishragaurav31/7Rt4D/ 5 / [ ^ ]
2:我遇到循环问题
http://jsfiddle.net/mishragaurav31/JgcS2/ [ ^ ]
请给出可能解决的问题
i have created two jsfiddle for row based calculation ,
here last two value are subtracted from first one.
eg: 10-2-6=2
for single row it works fine but i am getting problem for multiple rows
1: works fine as single row
http://jsfiddle.net/mishragaurav31/7Rt4D/5/[^]
2: i get problem with for loop
http://jsfiddle.net/mishragaurav31/JgcS2/[^]
kindly give what could be solution
推荐答案
JSFiddle: http://jsfiddle.net/JgcS2/25/ [ ^ ]
JSFiddle: http://jsfiddle.net/JgcS2/25/[^]
Updated HTML:
<form id="whereEntry" method='post' action=''>
<input type="text" class="income_count1" index="1" id="income1">
<input type="text" class="reduce_count1" index="1" id="income1" >
<input type="text" class="reduce_count1" index="1" id="reduce1" > <br>
<input type="hidden" id="income_red1" >
<input type="hidden" id="income_sum1" >
<br>
<input type="text" id="finale1" >
<br>
<hr>
<input type="text" class="income_count2" index="2" id="income2">
<input type="text" class="reduce_count2" index="2" id="income2" >
<input type="text" class="reduce_count2" index="2" id="reduce2" > <br>
<input type="hidden" id="income_red2" >
<input type="hidden" id="income_sum2" >
<br>
<input type="text" id="finale2" >
<br>
<hr>
</form>
更新的脚本:
Updated Script:
( document ).ready( function (){
for ( var abc = 1 ; abc< 3; abc ++)
{
( document ).ready(function() { for(var abc=1;abc<3;abc++) {
(' #whereEntry')。delegate( 。income_count + abc,' 更改',function ()
{
var incomeValue =
('#whereEntry').delegate(".income_count"+abc, 'change', function () { var incomeValue =
这篇关于Jquery简单查询添加了行的所有元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文