Calculate PDF checkboxes
Hey guys
I'm new here and I'm a complete novice at Javascript. I'm a designer that wants to get better at coding.
I'm trying to add a numeric value to the checkboxes in the 'size' row. Each of the 6 checkboxes will have a different value. Those values will be added together and multiplied by the values that will be inserted in the 'quantity' and 'colours' rows, to get a total. So the total at the end should be something like size(s)*quantity*colours.
I'm currently stuck at applying values to the checkboxes. I've been at it for about 2 weeks now (seriously) and haven't figure it out. I used arrays to group the checkboxes as seen in the code below. I can check which box is ticked, but I don't know how to apply values to the boxes and only calculate boxes that are ticked.
Any help would be greatly appreciated.
Thanks
var estimate = this.getField("estimate");
var sizesMale = ["male_small","male_medium","male_large","male_xl","male_2xl","male_3xl"];
var quantityMale = new Array("MQ1","MQ2","MQ3","MQ4","MQ5","MQ6");
function maleShirtPrice(){
var maleShirtPrices = 0;
for (var i = 0; i < sizesMale.length; i++)
{
sizesMale[i].exportValues = [100,200,300,400,500,600];
sz = this.getField(sizesMale[i]).exportValues;
};
console.println(sz);
if(sz.value = true)
{
maleShirtPrices = ;
};
return maleShirtPrices;
maleShirtPrices()
}
estimate.value = maleShirtPrice();

