/    Sign up×
Community /Pin to ProfileBookmark

I am having trouble getting my calculator to display anything. I have highlighted where I believe the problem is however I am new to this and clueless. Any help would be greatly appreciated.

<html>
<head>
<title>Investment Club Stock</title>
<script LANGUAGE=”JAVASCRIPT”>
<!–Hide from old browsers

[CODE]function diviTime(myform) {
var Time=document.Time.stockPrice.value
var Time=parseInt(Price,10)
if (isNaN(Price)) {
alert(“Enter the Stock Price”)
document.Time.stockPrice.value=” ”
document.Time.stockPrice.focus()
} else {
var Shares=document.Time.numShares.value
var Shares=parseInt(Shares,10)
if (isNaN(Shares)) {
alert(“Enter the number of shares”)
document.Time.numShares.value=” ”
document.Time.numShares.focus()
} else {
diviTimePrice=Price-(stockPrice * numShares)
document.Time.diviTime.value=diviTimePrice[/CODE]

}
}
}

//–>
</script>
</head>

<body>

<h2 align=”center”><font face=”Arial” Color=”blue”>
Investment Club Calculator</font></h2>
<div align=”center”><center>

<FORM></FORM> <Name=”Stock”>
</Name=”Stock”>
<table border=”0″ width=”60%”>
<tr>
<td width=”50%”><p align=”right”>Enter the current price of the stock: </td>
<td width=”50%”><Input Type=”text” Name=”stockPrice” value=” “></td>
</tr>
<tr>
<td width=”50%”><p align=”right”>Enter the number of shares owned: </td>
<td width=”50%”><Input Type=”text” Name=”numShares” value=” “></td>
</tr>
<tr>
<td width=”50%”><p align=”right”>Amount of dividends paid: </td>
<td width=”50%”><Input Type=”text” Name=”diviPaid” value=” “></td>
</tr>
<tr>
<td width=”50%”><p align=”right”>How often dividends are paid: </td>
<td width=”50%”><Input Type=”text” Name=”timePaid” value=” “></td>
</tr>
<tr>
<td width=”50%”><p align=”right”>You will earn a new share: </td>
<td width=”50%”><Input Type=”text” Name=”diviPaid” value=” “></td>
</tr>
<tr>
<td width=”50%”><p align=”right”><Input Type=”Button” Value=”Calculate” onClick=”Time()”></td>
<td width=”50%”><Input Type=”Reset”></td>
</tr>
</table>
</center></div>
</body>
</html>

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@FangNov 24.2010 — Incorrect use of form tags[CODE][COLOR="Blue"]<form action="" name="Time">[/COLOR]
<table border="0" width="60&#37;">
.
.
.
</table>
[COLOR="Blue"]</form>[/COLOR]
[/CODE]
Copy linkTweet thisAlerts:
@computerdoc87authorNov 24.2010 — Thanks for the info. I fixed that problem but it is still not displaying anything when I hit the calculate button.
Copy linkTweet thisAlerts:
@computerdoc87authorNov 24.2010 — <html>

<head>

<title>Pine Peaks Ski Lodge</title>

<script LANGUAGE="JAVASCRIPT">

<!--Hide from old browsers

function windChill(myform) {

var Temp=document.Chill.OutTemp.value

var Temp=parseInt(Temp,10)

if (isNaN(Temp)) {

alert("Enter the outdoor temperature")

document.Chill.OutTemp.value=" "

document.Chill.OutTemp.focus()

} else {

var Wind=document.Chill.windSpeed.value

var Wind=parseInt(Wind,10)

if (isNaN(Wind)) {

alert("Enter the average wind speed")

document.Chill.windSpeed.value=" "

document.Chill.windSpeed.focus()

} else {

windChillTemp=Temp-(1.5 * Wind)

document.Chill.WindChill.value=windChillTemp

}
}
}


//-->

</script>

</head>

<body>

<p align="center"><img src="PinePeaksLogo.jpg" width="296" height="65"

alt="NutriLogo.jpg (9306 bytes)"></p>

<h2 align="center"><font face="Flareserif821 BT" Color="#800040">

Wind Chill Calculator</font></h2>

<div align="center"><center>

<FORM Name="Chill">

<table border="0" width="60%">

<tr>

<td width="50%"><p align="right">Enter the outdoor temperature: </td>

<td width="50%"><Input Type="text" Name="OutTemp" value=" "></td>

</tr>

<tr>

<td width="50%"><p align="right">Enter the average wind speed: </td>

<td width="50%"><Input Type="text" Name="windSpeed" value=" "></td>

</tr>

<tr>

<td width="50%"><p align="right">The wind chill is: </td>

<td width="50%"><Input Type="text" Name="WindChill" value=" "></td>

</tr>

<tr>

<td width="50%"><p align="right"><Input Type="Button" Value="How Cold" onClick="windChill(Chill)"></td>

<td width="50%"><Input Type="Reset"></td>

</tr>

</table>

</center></div>

</body>

</html>
×

Success!

Help @computerdoc87 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...