I am trying to build a direct mail calculator and am taking it one step at a time. I am stuck because I need to calculate postage based on quantity entered and what size mailer they have chosen. Any help is greatly appreciate as I am a novice!
So far I have (PLEASE NOTE the array of printing_cost_formulas are just random numbers I put to check it worked):
var printing_cost_formulas = new Array();
var theForm = document.forms["cakeform"];
var mailertype = theForm.elements["mailertype"];
for(var i = 0; i < mailertype.length; i++)
PrintingCost = printing_cost_formulas[mailertype[i].value];
var PrintingCost = getPrintingCost();
var divobj = document.getElementById('totalPrice');
divobj.innerHTML = "Total Printing Cost $"+PrintingCost + mailer_quantity;
So, as an example I need help starting down a path of defining when the user wants 1,000 of 4x6 the price is 0.50 per piece. When they want 1,000 6x9 the price is 0.55 and so on. All the postage variables are known I just have no idea how to write the 'if, else' statement or define the quantity variable within this context!! AH!