Click here to Skip to main content
15,906,645 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
$('#btnCalculate'+index+index1).click(function () {

                               var total = 0;

                               $(':checkbox:checked.chkNumber').each(function () {

                               total += +this.value;

                               });

                               
                               $('#txtPlateRate'+index+index1).text(total);

                               });


We have ha Two div 1 Inner div and another is outer div.. in inner div we have a table which are enclosed by some check box and One text box and one button. All the control have different type of ID.. for example. in outer div suppose this outer div have an ID outerDiv0 in and Innerdiv00 checkboxfood00 and checkboxfood01. another have a input type label which have a Idlbl00 and value=200another label id lbl01 value=300. and have a input type button idis btncalculate02.

My problem is that when we using summation by two value this click function. If we use the checkbox by class name it will work. but It works all check box. I want that it will calculate each inner div part by part.. Please give me the solution how can I get the exact value.. please give me the code in jquery..

All the program are created in webservice
Posted
Comments
Sergey Alexandrovich Kryukov 8-Apr-14 1:43am    
This is pretty simple, but your explanation looks complicated. Perhaps you need to show some HTML, in that HTML, comment elements you want to make a set to iterate through, and add corresponding explanation in your text.
First idea is that you might need to loop through valid values of index, index1, or index+index1.
—SA
Member 10505864 8-Apr-14 1:48am    
please sir give me some code which is help ful for me
Sergey Alexandrovich Kryukov 8-Apr-14 2:02am    
But you did not provide the clarification I asked for. And it looks like you know all you need to know, just need to design a set of elements accurately and create one or more selectors giving you the set(s) to iterate.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900