Click here to Skip to main content
15,880,796 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
It works on my computer but whenever i uploaded it it doesnt work.


HTML
<HTML>
<HEAD>
<TITLE>Test Input</TITLE>
<style type="text/css">
<!--
.box {
    color: #060;
}
.box input { background-image: url(back.jpg);
             background-repeat: repeat-x;
             font-color: white;
             font-weight: bold;
             border: 1px solid black;

                   }


}
-->
</style>

<SCRIPT LANGUAGE="JavaScript">

    var testD=document.getElementById('display2').value;
    var testVar=document.getElementById('display').value;
     if(Number(testVar) > 50) {
        parseInt(testVar);
        parseInt(testD);
        testVar = (Number(testVar)+Number(10));
        testD = testVar;
    } else if(Number(testVar) > 45 && Number(testVar) < 51) {
        parseInt(testVar);
        parseInt(testD);
        testVar = (Number(testVar)+Number(9));
        testD = testVar;
    } else if(Number(testVar) > 40 && Number(testVar) < 46) {
        parseInt(testVar);
        parseInt(testD);
        testVar = (Number(testVar)+Number(8));
        testD = testVar;
    } else if(Number(testVar) > 35 && Number(testVar) < 41) {
        parseInt(testVar);
        parseInt(testD);
        testVar = (Number(testVar)+Number(7));
        testD = testVar;
    } else if(Number(testVar) > 30 && Number(testVar) < 36) {
        parseInt(testVar);
        parseInt(testD);
        testVar = (Number(testVar)+Number(6));
        testD = testVar;
    } else if(Number(testVar) > 25 && Number(testVar) < 31) {
        parseInt(testVar);
        parseInt(testD);
        testVar = (Number(testVar)+Number(5));
        testD = testVar;
    } else if(Number(testVar) > 20 && Number(testVar) < 26) {
        parseInt(testVar);
        parseInt(testD);
        testVar = (Number(testVar)+Number(4));
        testD = testVar;
    } else if(Number(testVar) > 15 && Number(testVar) < 21) {
        parseInt(testVar);
        parseInt(testD);
        testVar = (Number(testVar)+Number(3));
        testD = testVar;
    } else if(Number(testVar) > 10 && Number(testVar) < 16) {
        parseInt(testVar);
        parseInt(testD);
        testVar = (Number(testVar)+Number(2));
        testD = testVar;
    } else if(Number(testVar) > 5 && Number(testVar) < 11) {
        testD = testVar;
        testD++;
    } else {
        var testD = Number(testVar);
    }
    document.getElementById('display2').value=testD;
}
  </SCRIPT>
</HEAD>
<BODY>
Enter something in the box: <BR><P>
 <div class="box"> <font color=""> <input name="display" style="text-align: center; width: 50px;" value="">
  <input style="text-align: center; width:50px;; " value="0" name="display2">
  <input type="button" name="button" style=";" value="Click" onClick="calc()"></font></div>
</BODY>
</HTML>
Posted
Updated 26-Jan-11 14:44pm
v6
Comments
Sergey Alexandrovich Kryukov 26-Jan-11 18:47pm    
Impossible gibberish... how can it work in principle? What it supposed to do?
Why the text is attempted to hide using white color, limit size in pixel -- it defeats Web browsing scaling?
Whatever...
K4J95 26-Jan-11 18:56pm    
I made it so it doesnt turn white i had a bg image for this but obv. it wouldnt have worked

Could you plese try by clearing all the unwanted history/cache/temp files from the uploaded location.
 
Share this answer
 
Looks like you need to fix your PRE blocks. Some notes:
  • In your script tag, you should say type="text/javascript".
  • When you upload it, you may be viewing it with a different browser than that used by Visual Studio when you are debugging. That could account for the difference.
  • I recommend using the alert function to help yourself debug the uploaded version. That will help you find out which code is getting executed and you can figure out variable values.
 
Share this answer
 
Comments
K4J95 26-Jan-11 18:52pm    
actually I did user the alert and i did use the type="text/javascript" i concluded that the function wasnt even being executed at all and i still have this error
AspDotNetDev 27-Jan-11 1:55am    
Have you tried uploading a simple alert("hello")? You don't even need to put it into a function. Also, you still haven't indicated if you were using the same browser. Another possibility: scripting may be disabled remotely but allowed when executed locally (i.e., could be a security setting issue).

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900