Hi,
Can somebody help me. I'm quite new to Javascript and HTML and I'm having problems with the following code. What I'm trying to do is get a simple program that will work out the total charge. I just can't figure it out.
What it needs to do is work out the total charge for a customer, basically in the format shown, where the customer is charged a £3.00 delivery charge if the order value is under £25, nothing if over or equal to £25 and nothing again plus a free gift if it's equal to or over £100> I have become come completely stuck so bear with me if it looks a mess.
Can somebody please please help!!
Thanks in advance
Scott
-------------
<HTML>
<HEAD>
<TITLE>
Delivery charges
</TITLE>
<SCRIPT LANGUAGE = "JavaScript">
var orderValue; // How much the order is worth
var deliverycharge;
var total;
orderValue=window.prompt(How much is the order worth in Pounds Sterling?,);
document.write (The value of your order is £ + orderValue + .
);
orderValue = window.prompt('Please enter today\'s order value in Pounds Sterling', '');
orderValue = parseFloat(orderValue);
if (orderValue < 25)
{
document.write('Delivery Charge is £3.00')
document.write('The total charge of '+order value+' and '+deliverycharge' is '+total' + '
');
total = orderValue + 3;
}
else
{
if (orderValue >= 25)
{
document.write('Order will be delivered free')
total = orderValue
}
else
{
if (orderValue > 100)
total = orderValue
{
document.write('Order will be delivered free with a free gift')
}
else
{
document.write('
');
document.write ('Thank you for shopping with us.');
}
}
}
</SCRIPT>
</HEAD>
<BODY>
</BODY>
</HTML>