Thu Jun 04, 2009 9:23 pm
Hi, I have this exercise to do, and it's almost finished but I am stuck on the calculation. I need to calculate the total price. Not sure what I need to do to make the totalprice function work.
This is just a learning material. It only works in IE, and it's not a problem.
I can email the code to someone if needed.
This is the function that should calculate within a form but it doesn't.
function calculate(value)
{
var totalprice = value;
var notickets = value;
var ticketprice = value;
var add = 10
if(notickets < 4)
{
totalprice = (ticketprice * (notickets))
}
else if(notickets >= 4)
{
totalprice = (ticketprice * (notickets)) + add
}
else
{
alert("Before you can calculate your total price you have to make your selection.")
return false
}
}
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com
Powered by phpBB © phpBB Group.