I'm very new with javascript so I need help with what I think should be a very simple calculation. Here's what I'm trying to do:
Webpage contents:
drop down menu (S2) with set values for each item
drop down menu (S3) with set values for each item
form field (T1) for user input of number
push button (B3) to perform calculation
form field (T5) for calculation result
When the user selects items from S2 and S3 and puts a number in T1 then clicks B3 the result should show in T5.
This does not work correctly, the problem seems to be when I try to add 6 to y, because it gives me the correct answer with just y.
function ratings()
{
var t=document.cMount.S2.value;
var y=document.cMount.T1.value;
if (document.cMount.S3.value==12){
var Lmax=((2*t)*(146700/3))/y;}
if (document.cMount.S3.value==25){
var Lmax=((2*t)*(146700/3))/(y+6);}
if (document.cMount.S3.value==64){
var Lmax=((2*t)*(146700/3))/(y+6);}
document.cMount.T5.value=Lmax.toFixed(0);


