Help Me Please! I've been working on this code for about a week, I can't figure out how to calculate the user input in the forms. My code is attached. Any help would be greatly appreciated! I tried looking at the answer posted for Snowgirl's question but that really doesn't help me much. Thanks.
<html>
<head>
<title>
calculate interest//Robin Zolinas
</title>
</head>
<body>
<script language="Javascript">
function calculateInterest(){
var principal; principal= document.myForm.principal.value;
var interestRate; interestRate= document.myForm.interestRate.value;
var numberOfYears; numberOfYears= document.myForm.numberOfYears.value;
}
for (var i=0;i<principal;i=i+1){
principal=(document.myForm.principal.value*document.myForm.interestRate.value)+document.myForm.princ ipal.value;
}
</script>
<form name="myForm">
<input type="text" name="principal">Principal<br>
<input type="text" name="interestRate">Interest Rate<br>
<input type="text" name="numberOfYears">Number Of Years<br>
<input type="button" value=http://www.webdeveloper.com/forum/archive/index.php/"Calculate" onClick="calculateInterest()">
</form>
</body>
</html>
<html>
<head>
<title>
calculate interest//Robin Zolinas
</title>
</head>
<body>
<script language="Javascript">
function calculateInterest(){
var principal; principal= document.myForm.principal.value;
var interestRate; interestRate= document.myForm.interestRate.value;
var numberOfYears; numberOfYears= document.myForm.numberOfYears.value;
}
for (var i=0;i<principal;i=i+1){
principal=(document.myForm.principal.value*document.myForm.interestRate.value)+document.myForm.princ ipal.value;
}
</script>
<form name="myForm">
<input type="text" name="principal">Principal<br>
<input type="text" name="interestRate">Interest Rate<br>
<input type="text" name="numberOfYears">Number Of Years<br>
<input type="button" value=http://www.webdeveloper.com/forum/archive/index.php/"Calculate" onClick="calculateInterest()">
</form>
</body>
</html>