Jump to content

Syntax Check


user4fun

Recommended Posts

Hey guys, i am a hobbiest and i am learning as i gobut it seems like i am not learning in the right order so silly mistakes do happencan someone look at this and tell me what i need to fix thank you<Code><html><head><script language="JavaScript">function myfunction() {Var Sales = document.form1.Sales.valueVar Traffic = document.form1.Traffic.valuevar ErrorMess = "Wrong Value"var Message1 = "You have an EXTREMELY LOW"var Message2 = "You have a VER LOW"var Message3 = "You have a fairly low"var Message4 = "You currently have a reasonable number at"var Message5 = "You currently have the potential of dramatically….."var Message6 = "You have a ver successful….."var Message7 = "Thank you for visiting, we have no service to provide"var SalesPercent = Sales / Traffic * 100var MissTraffic = SalesPercent - 100if (SalesNum > Traffic) { document.writeln(ErrorMess); } else { If (SalesPercent < 10) { document.writeln(Message1 + " " + "<font color=red><b>" + SalesPercent + "%" + "</b></font>" + " and losing on potential sales of " + "<font color=red><b>" + MissTraffic + "%" + "</b></font>"); } else { If ( 20 > SalesPercent < 10) { document.writeln(Message2 + " " + "<font color=red><b>" + SalesPercent + "%" + "</b></font>" + " and losing on potential sales of " + "<font color=red><b>" + MissTraffic + "%" + "</b></font>"); } else { If ( 30 > SalesPercent < 20) { document.writeln(Message3 + " " + "<font color=red><b>" + SalesPercent + "%" + "</b></font>" + " and losing on potential sales of " + "<font color=red><b>" + MissTraffic + "%" + "</b></font>"); } else { If ( 30 > SalesPercent < 65) { document.writeln(Message4 + " " + "<font color=red><b>" + SalesPercent + "%" + "</b></font>" + " and losing on potential sales of " + "<font color=red><b>" + MissTraffic + "%" + "</b></font>"); } else { If ( 65 > SalesPercent < 95) { document.writeln(Message5 + " " + "<font color=red><b>" + SalesPercent + "%" + "</b></font>" + " and losing on potential sales of " + "<font color=red><b>" + MissTraffic + "%" + "</b></font>"); } else { if ( 95 > SalesPercent < 99.9) { document.writeln(Message6 + " " + "<font color=red><b>" + SalesPercent + "%" + "</b></font>" + " and losing on potential sales of " + "<font color=red><b>" + MissTraffic + "%" + "</b></font>"); } else { if ( SalesPercent == 100 ) { document.writeln(Message7) } } } } } } } }}</script></head><body><form name="form1">Sales: <INPUT TYPE = Text NAME = Sales SIZE = 5 value =""><br>Traffic: <INPUT TYPE = Text NAME = Traffic SIZE = 5 value =""><br><input type="button" value="Hit me" onclick="myfunction()"></form></body></html>

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...