Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I really need help with this... Its my first Javascript!! 1

Status
Not open for further replies.

MajorRawne

Programmer
May 15, 2007
3
GB
Please can someone cut this, correct it in notepad and paste it back in a reply im desperate its for some work im doing and im running out of time....

<HTML>
<HEAD>
<TITLE>
Deliver Charges
</TITLE>
<SCRIPT LANGUAGE = "JavaScript">

// A delivery charge program

var orderValue; // How much the order is worth

orderValue = window.prompt('How much is the order worth in Pounds Sterling?','');

document.write('The value of your order is £' + orderValue + '.<BR>');
orderValue = parseFloat(orderValue);
if (orderValue <= 24.99)
{
document.write('Your Charge For Delivery Is £3')
}
else
{
if (orderValue 25<=99.99)
{
document.write('Your Delivery Is Free Of Charge')
}
else
{
if (orderValue 100 >)
{
document.write('Your Deliver Is Free And Comes With A Complimentry Gift Vocher')
}
}
}

document.write('<BR>');
document.write('Thank you for shopping with us.');

</SCRIPT>
</HEAD>
 
Hi

Use a browser which helps webmasters. I am thinking to [link ]FireFox[/url]. It clearly indicates the line with error :
Code:
     if (orderValue 25<=99.99)
You just need to remove that 25 which breaks the expression.
Code:
     if (orderValue<=99.99)

Feherke.
 
thanks mate i made that change but it still doesnt work what am i doing wrong???
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top