on 01-02-2014 4:02 PM
Hi,
I need to get the row total and display it in the form for which i need some help on java script. pls can anyone throw some light or some help on it?
Hi Prabhu,
Do you need table like below ?
C1 | C2 | Total |
---|---|---|
2 | 3 | 5 |
3 | 4 | 7 |
4 | 4 | 8 |
If yes, please use below script, if you are planning to use javascript
var fields = xfa.layout.pageContent(xfa.layout.page(this)-1, "field", 0);
var total = 0;
for (var i=0; i <= fields.length-1; i++)
{
if (fields.item(i).name == "C1")
{
total = total + fields.item(i).rawValue;
}
if (fields.item(i).name == "C2")
{
total = total + fields.item(i).rawValue;
}
if (fields.item(i).name == "Total")
{
fields.item(i).rawValue = total;
total = 0;
}
}
else,
please create table type in interface and in code initialization, calculate the total column and use it accordingly in form.
Thanks,
Rakesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.