I have this code in the HEAD:
<script LANGUAGE="JavaScript">
<!--
function calculate(form)
{
height = eval(form.height.value)
width = eval(form.width.value)
photos = eval(form.photos.value)
lgtext = eval(form.lgtext.value)
mountlam = eval(form.mount.value)
mountlam = eval(form.lam.value)
GetPriceOne (form, height, width, photos, lgtext, mount, lam)
}
function GetPriceOne(form, height, width, photos, lgtext, mount, lam)
{
PriceOne = height * width
GetPriceTwo(form, height, width, photos, lgtext, mount, lam, PriceOne)
}
function GetPriceTwo(form, height, width, photos, lgtext, mount, lam, PriceOne)
{
PriceTwo = PriceOne / 144
GetPriceThree(form, height, width, photos, lgtext, mount, lam, PriceTwo)
}
function GetPriceThree(form, height, width, photos, lgtext, mount, lam, PriceTwo)
{
PriceThree = PriceTwo * 15
GetPriceFour(form, height, width, photos, lgtext, mount, lam, PriceThree)
}
function GetPriceFour(form, height, width, photos, lgtext, mount, lam, PriceThree)
{
if(form.lgtext.checked)
{
PriceFour = PriceThree + 20
GetPriceFive(form, height, width, photos, lgtext, mount, lam, PriceFour)
}
else
{
PriceFour = PriceThree
GetPriceFive(form, height, width, photos, lgtext, mount, lam, PriceFour)
}
}
function GetPriceFive(form, height, width, photos, lgtext, mount, lam, PriceFour)
{
if(form.mount.checked)
{
PriceFive = PriceFour + PriceTwo * 5
GetPriceSix(form, height, width, photos, lgtext, mount, lam, PriceFive)
}
else
{
PriceFive = PriceFour
GetPriceSix(form, height, width, photos, lgtext, mount, lam, PriceFive)
}
}
function GetPriceSix(form, height, width, photos, lgtext, mount, lam, PriceFive)
{
if(form.lam.checked)
{
PriceSix = PriceFive + PriceTwo * 5
GetPriceSeven(form, height, width, photos, lgtext, mount, lam, PriceSix)
}
else
{
PriceSix = PriceFive
GetPriceSeven(form, height, width, photos, lgtext, mount, lam, PriceSix)
}
}
function GetPriceSeven(form, height, width, photos, lgtext, mount, lam, PriceSix)
{
total = (photos * 4.95) + PriceSix
WriteDocument(total)
}
function RoundToPennies(n)
{
pennies = n * 100;
pennies = Math.round(pennies);
strPennies = "" + pennies;
len = strPennies.length;
return strPennies.substring(0, len - 2) + "." + strPennies.substring(len - 2, len);
}
function WriteDocument(total)
{
alert("Estimated price of this collage is ONLY $" + RoundToPennies(total))
}
//-->
</script>
If I want it to go into this text box, what do i need to do to the function?
<INPUT TYPE = Text NAME = "collageEstimate" SIZE = 25 />
<input type="button" value="Calculate Estimate" name="B1" onclick="calculate(this.form)" />
Please help! I've been at this for hours and have tried everything I know!!! Here is the actual page as it now, working with the alert-popup: http://procollage.com/site10/pricing/photo-collage-pricing.html