Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-21-2010, 06:32 PM   PM User | #1
computerdoc87
New to the CF scene

 
Join Date: Nov 2010
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
computerdoc87 can only hope to improve
Help!!! ASAP

<HTML>
<HEAD>
<TITLE></TITLE>
<SCRIPT LANGUAGE="JAVASCRIPT"><!--Hide from old browsers

var msgSpace = "--- ---"
var beginPos = 0


function doMort() {
document.MortCalc.Price.value=" "
document.MortCalc.Shares.value=" "
document.MortCalc.Dividend.value=" "
document.MortCalc.Time.value=" "
document.MortCalc.Price.focus()


}

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

}
open("Notice.htm","noticeWin","WIDTH=400,HEIGHT=220")
computerdoc87 is offline   Reply With Quote
Old 11-21-2010, 06:44 PM   PM User | #2
Philip M
Supreme Master coder!

 
Philip M's Avatar
 
Join Date: Jun 2002
Location: London, England
Posts: 17,044
Thanks: 197
Thanked 2,412 Times in 2,390 Posts
Philip M has a spectacular aura aboutPhilip M has a spectacular aura aboutPhilip M has a spectacular aura about
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.
Philip M is offline   Reply With Quote
Old 11-21-2010, 09:48 PM   PM User | #3
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,248
Thanks: 59
Thanked 3,999 Times in 3,968 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
You missed one major thing, Philip:

WHAT THE HECK IS THE PROBLEM????

All he does is slap a bunch of code up there and expect the clairvoyants to know what he wants done with it.

Maybe we should just format it for him and tell him it's now perfect???
__________________
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.
Old Pedant is offline   Reply With Quote
Old 11-22-2010, 02:50 AM   PM User | #4
computerdoc87
New to the CF scene

 
Join Date: Nov 2010
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
computerdoc87 can only hope to improve
What a bunch of assholes!!!

What a bunch of assholes!!!
computerdoc87 is offline   Reply With Quote
Old 11-22-2010, 03:38 AM   PM User | #5
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,248
Thanks: 59
Thanked 3,999 Times in 3,968 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
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.
Old Pedant is offline   Reply With Quote
Old 11-22-2010, 10:32 AM   PM User | #6
Philip M
Supreme Master coder!

 
Philip M's Avatar
 
Join Date: Jun 2002
Location: London, England
Posts: 17,044
Thanks: 197
Thanked 2,412 Times in 2,390 Posts
Philip M has a spectacular aura aboutPhilip M has a spectacular aura aboutPhilip M has a spectacular aura about
Quote:
Originally Posted by Old Pedant View Post
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.
Philip M is offline   Reply With Quote
Old 11-22-2010, 02:09 PM   PM User | #7
connollyc4
New Coder

 
Join Date: Mar 2010
Location: New Jersey USA
Posts: 74
Thanks: 11
Thanked 4 Times in 4 Posts
connollyc4 is an unknown quantity at this point
He did the samething here:

http://www.web-developer.com/forum/s...d.php?t=238722
connollyc4 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:50 PM.


Advertisement
Log in to turn off these ads.