Please Help Me

wxdqz

New Member
I'm new to Javascript. Why isn't this code working? I just want it to do a simple calculation. I haven't taken any classes, and I don't understand books very well. I looked at other codes, and mine looks like it should work (that is how i learn, i have to know what i did wrong after doing, not just being thrown a bunch of code in a book) can anyone help me?

<head>
</style>

<SCRIPT LANGUAGE="JavaScript">
<!begin
function calc1(form) {
a=eval(form.a.value)
b=eval(form.b.value)
c=(a+b)*(4.35)
form.ans.value = c
}
// End -->
</script>
</head>
<body>
<form name="shields">
<table border=1 cellpadding=4 cellspacing=1>
<tr>
<td align=center>Calculate Shields Here
<br>
<br>
Current Land: <input type="text" name="a" size=5>
<br>
Future Land: <input type="text" name="b" size=5>
<br>
<br>
Answer: <input type="text" name="ans"
size=5>
<br>
<input type="button" value=http://www.webdeveloper.com/forum/archive/index.php/"Calculate" onClick="calc1(this.form)">
</tr>
</table>
</form>
</body>
 
Back
Top