Hi,
You can do that using a table.You can add records or delete records using the Buttons.
Based on the category "A" the total is calculated. Below is the script you can refer for the final total of Category "A".
Below script is on the Calculate event of the Total 3 field and Language is JavaScript.
this.rawValue = total1.rawValue + total2.rawValue
Below script is on Calculate Event of the final Total field and Language is JavaScript.
// Getting the count of number of rows repeated
var numberOfRows = form1.Page1.AddorRemove.Row2.instanceManager.count;
//final total initialization
var total = 0;
for (var i=0; i<numberOfRows; i++){
// checking category is selected or not
if( xfa.resolveNode("form1.Page1.AddorRemove.Row2["+i+"].Category") != null && xfa.resolveNode("form1.Page1.AddorRemove.Row2["+i+"].Category").rawValue != null ){
// getting the category values
var categoryValue = xfa.resolveNode("form1.Page1.AddorRemove.Row2["+i+"].Category").rawValue;
// Matching the category values with "A"
if (categoryValue == "A"){
// Summing the total based on the "A" Category
total += xfa.resolveNode("form1.Page1.AddorRemove.Row2[" + i + "].Total3").rawValue;
}
}
}
I hope this script would give you idea. if you cant understand let me know or mail me you form to muchukotavijay@gmail.com.
Vjay