I have been getting an object expected error for a while now and I don't know why. Here is a simplified version of my code:
<body>
<form name="show" method="post" action="">
<input name="11" type="text" id="11" value="0" onChange="doMath();"><br>
<input name="21" type="text" id="21" value="0" onChange="doMath();"><br>
<input name="31" type="text" id="31" value="0"><br>
</form>
<script language="JavaScript">
<!--
function doMath() {
document.show.31.value= document.show.11.value + document.show.21.value;
}
//-->
</script>
</body>
I have tried parseInt just in case the text input needed to be changed to an int to get the same results. In the long run I want to limit users to entering an int from 0 to 20 and then have one read-only text input that displays the totals. Any advice/help?
<body>
<form name="show" method="post" action="">
<input name="11" type="text" id="11" value="0" onChange="doMath();"><br>
<input name="21" type="text" id="21" value="0" onChange="doMath();"><br>
<input name="31" type="text" id="31" value="0"><br>
</form>
<script language="JavaScript">
<!--
function doMath() {
document.show.31.value= document.show.11.value + document.show.21.value;
}
//-->
</script>
</body>
I have tried parseInt just in case the text input needed to be changed to an int to get the same results. In the long run I want to limit users to entering an int from 0 to 20 and then have one read-only text input that displays the totals. Any advice/help?