function Calc(myform) {
var mortAmount=document.MortCalc.Price.value
var mortAmount=parseInt(mortAmount,10)
if (isNaN(mortAmount)) {
alert()
document.MortCalc.Price.value=" "
document.MortCalc.Price.focus()
}
else {
var mortShares=document.MortCalc.Shares.value
var mortShares=parseFloat(mortShares)
if (isNaN(mortShares)) {
alert()
document.MortCalc.Shares.value=" "
document.MortCalc.Shares.focus()
}
else {
var mortDividend=document.MortCalc.Dividend.value
var mortDividend=parseInt(mortDividend,10)
if (isNaN(mortDividend)) {
alert(")
document.MortCalc.Dividend.value=" "
document.MortCalc.Dividend.focus()
}
}
}
document.MortCalc.Time.value=monthly(mortPrice,mortShares,mortDividend)
document.MortCalc.Time.value=dollarFormat(document.MortCalc.Time.value)
}
function Price(mortPrice,mortShares) {
var Price * Shares
}
function dollarFormat(valuein) {
var formatStr=""
var Outdollars=""
var decipos=valuein.indexOf(".")
if (decipos==-1)
decipos=valuein.length
var dollars=valuein.substring(0,decipos)
var dollen=dollars.length
if (dollen>3) {
while (dollen>0) {
tDollars=dollars.substring(dollen-3,dollen)
if (tDollars.length==3) {
Outdollars=","+tDollars+Outdollars
dollen=dollen-3
} else {
Outdollars=tDollars+Outdollars
dollen=0
}
}
if (Outdollars.substring(0,1)==",")
dollars=Outdollars.substring(1,Outdollars.length)
else
dollars=Outdollars
}
var cents=valuein.substring(decipos+1,decipos+3)
if (cents=="")
cents="00"
var formatStr="$"+dollars+"."+cents
return formatStr
Before you continue posting in this forum please read the forum rules and posting guidelines. Especially:-
The posting guidelines regarding silly thread titles. The thread title is supposed to help people who have a similar problem in future. Yours is useless for this purpose. You can (and should) edit it to make it more meaningful. And ASAP is simply rude. People are not standing around here 24/7 just waiting to jump to it when you decide you want something.
When posting here please follow the posting guidelines and wrap your code in CODE tags. This means use the octothorpe or # button on the toolbar. You can (and should) edit your previous post.
<script language=javascript> is long deprecated and obsolete. Use <script type = "text/javascript"> instead. The <!-- and //--> comment (hiding) tags have not been necessary since IE3 (i.e. since September 1997). If you see these in some published script it is a warning that (as here) you are looking at ancient and perhaps unreliable code.
Finally, have you tried using your error console? You cannot expect other people to find out the syntax errors in your code.
Now *THAT* is the way to get help! LOL! Just as soon as hell freezes over.
I will tell you that so little of that code makes sense that I really don't have any idea what it is supposed to do. But I suspect that's your problem, too.
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Now *THAT* is the way to get help! LOL! Just as soon as hell freezes over.
I will tell you that so little of that code makes sense that I really don't have any idea what it is supposed to do. But I suspect that's your problem, too.
He is only an immature child. But it amazes me that even children are so dim-witted as to think they will gain anything by hurling abuse at people who they expect to help them. That certainly signals the end of this guy's career in this forum.