Jump to content

user4fun

Members
  • Posts

    573
  • Joined

  • Last visited

Everything posted by user4fun

  1. Okaywhat about visible status like is MScan i make a bunch of things visible = falseuntill the onclick function takes place and themvisible = truewhat would that look like
  2. I wanted to send these varvar Sales var Traffic var ProfitPerCust var SalesPercent var MissTraffic GainedCustomers = SalesPercentLostCustomers = MissTrafficProfitEarned = SalesPercent * ProfitPerCustLostPotentialProfit = LostCustomers * ProfitPerCustIn a way i would like to send the results of the If statments. If i cannot do that then i guess i can rewrite them in the presults.html page correct.
  3. Where would i put the code that you have given methis is what i have so far.<code><html><head><script language="JavaScript">function myfunction() {//window.open("http://www.odoc.us/results.htm")var Sales = document.cal.Sales.valuevar Traffic = document.cal.Traffic.valuevar ProfitPerCust = document.cal.APPC.valuevar ErrorMess = "An Error has occured. Please make sure that all values are corect and the sales value is smaller than the number of traffic"var Message1 = "You have an EXTREMELY LOW"var Message2 = "You have a VER LOW"var Message3 = "You have a fairly low"var Message4 = "4444"var Message5 = "5555"var Message6 = "66666"var MessageA = "Gained Customers"var MessageB = "Lost Customers"var MessageC = "Profit Earned"var MessageD = "Lost Protential Profit"var SalesPercent = Sales / Traffic * 100var MissTraffic = 100 - SalesPercent//OUT OF 100 CUSTOMER INFOGainedCustomers = SalesPercentLostCustomers = MissTrafficProfitEarned = SalesPercent * ProfitPerCustLostPotentialProfit = LostCustomers * ProfitPerCustif (SalesPercent <= 10) { document.write(Message1 + " " + Math.round(SalesPercent) + "%" + " " + "Sales Percentage" + "<br />"); document.write ("<br />") document.write("your business analysis based on every 100 customers." + "<br />") ; document.write(MessageA + " " + "=" + " " + Math.round(GainedCustomers) + "<br />") ; document.write(MessageB + " " + "=" + " " + Math.round(LostCustomers) + "<br />"); document.write(MessageC + " " + "=" + " " + Math.round(ProfitEarned) + "$" +"<br />"); document.write(MessageD + " " + "=" + " " + "$" + Math.round(LostPotentialProfit) +"<br />"); } else if (SalesPercent > 10 && SalesPercent <= 20) { document.write("under 10") } else if (SalesPercent >=21 && SalesPercent <= 35) { document.write("netween 10 and 59") } else if (SalesPercent >=36 && SalesPercent <= 49) { document.write("between 36 nd 49") } else if (SalesPercent >=50 && SalesPercent <= 99) { document.write("Between 50 and 99") } else if (SalesPercent == 100) { document.write("???") } else { document.write(ErrorMess) } } </script></head><body><form name="FrontPage_Form1" onsubmit="return FrontPage_Form1_Validator(this)" language="JavaScript"><table border="0" id="table1" width="556"><tr> <td width="550"><font size="2">Enter your information based on a 24 business period.</font></td> </tr> </table> <table border="0" id="table2" width="555"><tr> <td width="50"><font size="2">Sales</font></td> <td> <!--webbot bot="Validation" s-data-type="Number" s-number-separators=",." b-value-required="TRUE" s-validation-constraint="Greater than or equal to" s-validation-value="0" --><input type = "text" name="Sales" size="10" value = ""></td></tr><tr> <td width="50"><font size="2">Traffic</font></td> <td> <!--webbot bot="Validation" b-value-required="TRUE" s-validation-constraint="Greater than or equal to" s-validation-value="0" --><input type = "text" name="Traffic" size="10" value = ""></td></tr><tr> <td width="50"><font size="2">AP/C</font></td> <td> <!--webbot bot="Validation" b-value-required="TRUE" s-validation-constraint="Greater than or equal to" s-validation-value="0" --><input type = "text" name="APPC" size="10" value = ""><i><font size="1">Average Profit Per Customer</font></i></td></tr><tr> <td width="84"><input type ="button" value="Calculate" onclick = "myfunction()" ></td> </tr> </table> </form></body></html></code>
  4. URL String Query --------------------------------------------------------------------------------I believe what i am trying to do is called url stirng query. Anyways,I have an html page, it contains javascript (text) with in javascript afew equations are made after onclick "button"I really need for the results to show up i a different pagePResults.htm (in the body of the page)so really i trying to figure out how to send the values from Info.html to PResults.htmlplease please please help me,
  5. user4fun

    HTML TAGS

    Where would i use the <br> tag in this java script to start a new line with every documnet.writealso, I would like to limit the results to 2 dicimal placesThank youif (SalesPercent < 10) {document.write(Message1 + " " + SalesPercent + "%" + " "); document.write(MessageA + " " + "=" + " " + GainedCustomers + " ") ;document.write(MessageB + " " + "=" + " " + LostCustomers + " ");document.write(MessageC + " " + "=" + " " + ProfitEarned + "$" +" ");document.write(MessageD + " " + "=" + " " + LostPotentialProfit + "$");Thank you for being nice to the new guyEDITTINGOK AY, i figured one part out document.write(Message1 + " " + Math.round(SalesPercent) + "%" + "<br />"); still working on the decimal points lol
  6. Hello every one, i am a noobielittle help pleasei have this code, i would like to modidy it so the results wouyld be replaced instead if added to each otherright now it shows 012345i would like it to count 0 to 5 but replace the 0 then 1, then the 1 would be replace with 2 and then 2 with be reaplace and so onI would like to also add a little like that would change the time interval between changedfor ecampleTimeInterval = 0.4the it would change the numbe counting up every 0.4 secondsThank you all
  7. 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>
  8. Hello everyone, i am new at this and i wanted to take the time to understand how the if---elseif statments work so i can give you as much info as i can so you might jsut be able to help mehere is what i would like to do in HUMAN CODE lolUser Inputs two values in two textboxes1 – SalesNum2 – TrafficThen the user would click on a command button “calculate”CONSTANT VALUESErrorMess= Wrong ValueMessage1=You have an EXTREMELY LOWMessage2= You have a VER LOWMessage3= You have a fairly lowMessage4= You currently have a reasonable number at Message5= You currently have the potential of dramatically…..Message6= You have a ver successful…..”Message 7= Thank you for visiting, we have no service to provideEquation to be used when user hits the command buttonSalesPercent = SalesNum/Traffic * 100MissTraffic = SalesPercent – 100If SalesNum > TrafficPrint ErrorMessElseIf SalesPercent < 10Message1 (red bold font) ‘SalesPercent’ (end red bold font) and losing on potential sales of (red bold font) ‘MissTraffic’ (stop red bold font)If 20 > salesPercent < 10 ( if SalesPercent is between 10 and 20)Message2(red bold font) ‘SalesPercent’ (end red bold font) and losing on potential sales of (red bold font) ‘MissTraffic’ (stop red bold font)If 30 > salesPercent < 20 ( if SalesPercent is between 20 and 30)Message3(red bold font) ‘SalesPercent’ (end red bold font) and losing on potential sales of (red bold font) ‘MissTraffic’ (stop red bold font)If 30 > salesPercent < 65 ( if SalesPercent is between 30 and 65)Message4(red bold font) ‘SalesPercent’ (end red bold font) and losing on potential sales of (red bold font) ‘MissTraffic’ (stop red bold font)If 65 > salesPercent < 95 ( if SalesPercent is between 65 and 95)Message5(red bold font) ‘SalesPercent’ (end red bold font) and losing on potential sales of (red bold font) ‘MissTraffic’ (stop red bold font)If 95 > salesPercent < 99.9 ( if SalesPercent is between 95 and 99.9)Message6 (red bold font) ‘SalesPercent’ (end red bold font) and losing on potential sales of (red bold font) ‘MissTraffic’ (stop red bold font)If SalesPercent = 100Message7End all If’sThank you all for your helpIT WOULD be great if i get the code for like the first 2 messages and then i can jsut add the rest myself.THANKX FOR HELPING THE NEW GUY
×
×
  • Create New...