Dolan
05-29-2003, 07:53 PM
Hello. What's wrong with this:
<form name="ms">
Level: <input type="text" name="input" value="" size="10">
<input type="button" onClick="scalc(ms.input.value);" value="Calculate!">
Defense in %: <input type="text" name="output" size="35">
</form>
<script type="text/javascript">
function scalc(w) {
if (w == "0") {
ms.output.value = "Hey, you can't expect something from 0";}
if (w > "0") {
ms.output.value = Math.roof(w/9)*0.455+0.114;}
}
</script>
It only prints when input is 0. So I guess there's something wrong with the math expression.
Thanx for a good page that have helped me alot.
<form name="ms">
Level: <input type="text" name="input" value="" size="10">
<input type="button" onClick="scalc(ms.input.value);" value="Calculate!">
Defense in %: <input type="text" name="output" size="35">
</form>
<script type="text/javascript">
function scalc(w) {
if (w == "0") {
ms.output.value = "Hey, you can't expect something from 0";}
if (w > "0") {
ms.output.value = Math.roof(w/9)*0.455+0.114;}
}
</script>
It only prints when input is 0. So I guess there's something wrong with the math expression.
Thanx for a good page that have helped me alot.