Hello
Sorry for asking a noob question but need help with a math script.
I’m trying to get 2 functions, I guess thats what you would call it to work
in one script. I can’t seem to get var100_var107 to show after the process
has been completed. If someone can help on this. I thank them very much.
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “
<html xmlns=”
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″ />
<title>Untitled Document</title>
<script language=”javascript” type=”text/javascript”>
function units2cases(form) {
var100=eval(form.var100.value)
var101=eval(form.var101.value)
var102=eval(form.var102.value)
var103=eval(form.var103.value)
var100_var107=var100+var101+var102+var103
units=var100_var107
cases=eval(form.cases.value)
casetotal=units/cases
form.casetotal.value=casetotal
}
</script>
</head>
<body>
<form>
Variety Units
<br />
<input name=”var100″ type=”text” id=”var100″ value=”0″ size=”3″ maxlength=”4″ />
<br />
<input name=”var101″ type=”text” id=”var101″ value=”0″ size=”3″ maxlength=”4″ />
<br />
<input name=”var102″ type=”text” id=”var102″ value=”0″ size=”3″ maxlength=”4″ />
<br />
<input name=”var103″ type=”text” id=”var103″ value=”0″ size=”3″ maxlength=”4″ />
<br />
<input name=”var100_var107″ type=”text” value=”0″ size=”3″ maxlength=”4″ />
<br />
<input type=”hidden” name=”units” value=”0″ id=”units” />
<input type=”hidden” name=”cases” value=”36″ id=”cases” />
<br />
Variety Units to Whole Cases
<br />
<input name=”casetotal” type=”text” id=”casetotal” onfocus=”units2cases(this.form)” value=”0″ size=”3″ maxlength=”4″ />
</form>
</body>
</html>