elwell
08-07-2003, 05:18 PM
I want have a varible named "money" and the intial value is 500. Then I want the have whatever is typed in the "amount" textbox to be multiplyed by 12 . Then subtract whatever money * 12 is from the 500. Then money is set to its new number and if more is subracted later on it wont subtract from 500 instead it will subtract from the new "money". It tried to do part of it but it always says that money is zero even though it shouldn't be.
<html><head><title>Current Stocks</title>
<script type="text/javascript">
money = new Number
money = 500 - document.getElementById('amount').value
function addUp() {
alert("You Just Spent $"+document.getElementById('amount').value *12+". You Have $" +money +" Left Over");
}
</script>
<style type="text/css">
.links {position: absolute; top:440px; left:290px; font-family: Trebuchet MS, sans-serif; font-weight: normal; font-size:12}
</style>
</head>
<body>
<span style="position: absolute; top:30px; left:240px; font-family: Trebuchet MS, sans-serif; font-size: 40">Current Stocks</span>
<span class="links"><a href="about.html">About</a> | <a href="dowjon.html">Home</a> | <a href="contact.html">Contact Us</a> | <a href="faq.html">FAQ</a></span>
<span style="position: absolute; top:200px; left:0px; font-family: Trebuchet MS, sans-serif; font-size: 12"><marquee>
<font color="green" size="5">ABHC + 5 = 16</font>
                 
<font color="red" size="5">CCHHY -3 = 20</font>
                 
<font size="5">CHRIS = 40</font>
                 
<font color="green" size="5">DADO +46 = 5</font>
                 
<font color="red" size="5">JON -3 = 67</font>
                 
<font size="5">LIZ  = 45</font>
                 
<font size="5">MOM  = 98</font>
                 
<font color="red" size="5">ZYTY -3 = 23</font>
                 
</span>
</marquee>
<span style="position: absolute; top:120px; left:40px; font-family: Trebuchet MS, sans-serif; font-size: 12">
<form name="stockform">
The DOW JON STOCK EXCHANGE is at an all-time high.<br />Buy DOW JON Stock Today.<br />
Tag:<input name="tag" type="textbox" size="7" /><br />
How Many Shares:<input name="amount" id="amount" type="textbox" size="4" /><br />
<a href="javascript:addUp()">Buy</a><br />
(You cant buy or sell stocks if your not <a href="dowjon.html">logged in</a>)
</form>
</span>
</body>
</html>
<html><head><title>Current Stocks</title>
<script type="text/javascript">
money = new Number
money = 500 - document.getElementById('amount').value
function addUp() {
alert("You Just Spent $"+document.getElementById('amount').value *12+". You Have $" +money +" Left Over");
}
</script>
<style type="text/css">
.links {position: absolute; top:440px; left:290px; font-family: Trebuchet MS, sans-serif; font-weight: normal; font-size:12}
</style>
</head>
<body>
<span style="position: absolute; top:30px; left:240px; font-family: Trebuchet MS, sans-serif; font-size: 40">Current Stocks</span>
<span class="links"><a href="about.html">About</a> | <a href="dowjon.html">Home</a> | <a href="contact.html">Contact Us</a> | <a href="faq.html">FAQ</a></span>
<span style="position: absolute; top:200px; left:0px; font-family: Trebuchet MS, sans-serif; font-size: 12"><marquee>
<font color="green" size="5">ABHC + 5 = 16</font>
                 
<font color="red" size="5">CCHHY -3 = 20</font>
                 
<font size="5">CHRIS = 40</font>
                 
<font color="green" size="5">DADO +46 = 5</font>
                 
<font color="red" size="5">JON -3 = 67</font>
                 
<font size="5">LIZ  = 45</font>
                 
<font size="5">MOM  = 98</font>
                 
<font color="red" size="5">ZYTY -3 = 23</font>
                 
</span>
</marquee>
<span style="position: absolute; top:120px; left:40px; font-family: Trebuchet MS, sans-serif; font-size: 12">
<form name="stockform">
The DOW JON STOCK EXCHANGE is at an all-time high.<br />Buy DOW JON Stock Today.<br />
Tag:<input name="tag" type="textbox" size="7" /><br />
How Many Shares:<input name="amount" id="amount" type="textbox" size="4" /><br />
<a href="javascript:addUp()">Buy</a><br />
(You cant buy or sell stocks if your not <a href="dowjon.html">logged in</a>)
</form>
</span>
</body>
</html>