Click to See Complete Forum and Search --> : A Very Easy Question


elwell
08-06-2003, 01:31 PM
How can i extract the "amount" input and put it in a alert on other things?

<html><head><title>Current Stocks</title>
<script type="text/javascript">
function addUp() {
alert("You Had $500... Now You Have $" +parseInt('document.getElementById('amount').value'))
}
</script>
</head>
<body>
<span style="position: absolute; top:30px; left:240px; font-family: Trebuchet MS, sans-serif; font-size: 40">Current Stocks</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&nbsp=&nbsp16</font>

&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp

<font color="red" size="5">CCHHY -3&nbsp=&nbsp20</font>

&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp

<font size="5">CHRIS&nbsp=&nbsp40</font>

&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp

<font color="green" size="5">DADO +46&nbsp=&nbsp5</font>

&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp

<font color="red" size="5">JON -3&nbsp=&nbsp67</font>

&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp

<font size="5">LIZ &nbsp=&nbsp45</font>

&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp

<font size="5">MOM &nbsp=&nbsp98</font>

&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp

<font color="red" size="5">ZYTY -3&nbsp=&nbsp23</font>

&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp

</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>
</form>
</span>

</body>
</html>

kdcgrohl
08-06-2003, 01:37 PM
try this...


alert("You Had $500... Now You Have $"+document.getElementById('amount').value);

elwell
08-06-2003, 01:41 PM
Thanks;)

elwell
08-06-2003, 01:53 PM
I want have 500 then subract 'amount' from the five hundred and alert that and then set the 500 variable to the new number

function addUp() {

alert("You Had $500... Now You Have $"+500 -document.getElementById('amount').value);

</script>

what i just wrote doesn't work. How do you really do it.