Enter how much you can afford to save each month, how long you can save this amount, and the interest rate you can get on your savings and this script will display your total savings.
Add the below code to the <body> section of your page:
<scriptlanguage="javascript"type="text/javascript"> /* Visit http://www.yaldex.com/
for full source code
and get more free JavaScript, CSS and DHTML scripts! */
<!-- Begin var
i =0;// interest var
m =0;// months var
f =0;// factor var
den =0; var
s ="0";// string var
d =0;// decimal place function
CalcA(){ if(document.calform.interest.value==""||document.calform.months.value==""||document.calform.payment.value==""){ alert("Please
fill in all of the required fields.");
} else{ if(document.calform.period.options[1].selected==true){ m =document.calform.months.value*12;
} else{ m =document.calform.months.value;
} i =Math.pow(((document.calform.interest.value/100)+1),.0833333)-1; den =
i /(i+1); f =Math.pow((i+1),m)-1; f /=
den; f *=document.calform.payment.value; d =String(f).indexOf("."); s =String(f).substring(0,(d+3)); document.calform.total.value="$"+
s; }
} // End --> </script> <formmethod=postname="calform"> <tablewidth=400>
<tr>
<td
align=rightwidth=200>Total
invested each month:</td>
<td><inputtype=textname=paymentsize=13maxlength=13></td>
</tr>
<tr>
<td
align=rightwidth=200>Number
of months/years to aquire sum:</td>
<td><inputtype=textname=monthssize=3maxlength=3>
<selectname=periodsize=1>
<optionvalue="m">Months <optionvalue="y">Years </select> </td>
</tr>
<tr>
<td
align=rightwidth=200>Interest
rate on savings:</td>
<td><inputtype=textname=interestsize=5maxlength=5><b>
%</b></td>
</tr>
<tr>
<td
width=200colspan=2align=center> <inputtype=buttonname=button1value="How
much will I have?"onClick="javascript:CalcA()"></td>
</tr>
<tr>
<td
colspan=2align=centerwidth=200nowrap>Total
: <inputtype=textname=totalvalue="0.00"size=15maxlength=15></td>
</tr>
</table> </form>