messup000
Jan 11th, 2006, 08:44 PM
Hey everyone I need a little help again :( I am rewriting my calculator program and am having problems with my code...
function disp_prompt()
{
var i= document.getElementById("investment").value;
var r= document.getElementById("reinvest").value;
r=r - 0;
i=i - 0;
c=0+1
s=0
s1=100
s2=1000
s3=10000
q=100
q2=200
q3=300
total=0
if (i>s && i<s1);
if (c=1)<----- I cant get JS to recognize this code it just passes over it... or just doesnt do anything
{
total=i + i * q / 100
for (i=2;i<=r;i++)
total=total + total * q / 100
document.getElementById("profit").value= "$" +total 'but if i add a "+ c" it will add the number...
}
else
{
total=1000009
document.getElementById("profit").value= "$" +total
}
}
What am I doing wrong????
function disp_prompt()
{
var i= document.getElementById("investment").value;
var r= document.getElementById("reinvest").value;
r=r - 0;
i=i - 0;
c=0+1
s=0
s1=100
s2=1000
s3=10000
q=100
q2=200
q3=300
total=0
if (i>s && i<s1);
if (c=1)<----- I cant get JS to recognize this code it just passes over it... or just doesnt do anything
{
total=i + i * q / 100
for (i=2;i<=r;i++)
total=total + total * q / 100
document.getElementById("profit").value= "$" +total 'but if i add a "+ c" it will add the number...
}
else
{
total=1000009
document.getElementById("profit").value= "$" +total
}
}
What am I doing wrong????