can you have if statments inside functions like I have below its just the code below works but it doesnt output the comment part at all . any idea sorry
Code:
<SCRIPT language=JavaScript>
function perc1() {
a = document.form1.a.value;
b = a*document.form1.b.value;
document.form1.total1.value = b;
[B] if (total1 <10) {
form1.comment1.value="some random commet 1 ";
}
else if (total1 >40) {
form1.comment1.value="some random comment 2 ";
}
}[/B]
</SCRIPT>