Referencing the textbox's data

When I add in for the part in red m=1 it prints out “1” in the textbox so the error must be in the part in red.

<script type=“text/javascript”>
function monthdate(){
var m=number(window.document.myform.mo.value);
window.document.myform.t.value = m;
}
</script>
<form name=“myform”>
<table><tr><td align=“Center”><INPUT TYPE=“text” NAME=“mo” VALUE=“9” SIZE=“4”></td><INPUT TYPE=“button” NAME=“month” VALUE=“Calculate month” onClick=“monthdate()”/></td><td align=“Center” colspan=“4”><INPUT TYPE=“text” NAME=“t” SIZE = “”></td></tr></table>
</form>

This will do it, but you need error handling for out of range numbers and non-number entries. I have removed your number object and replaced it with a parseInt() which does the same job. The short cut to the form just simplifies the code making it more readable. I also needed to add a little to your table.

<html>

<head>

<script type=“text/javascript”>
<!–
// initialise on page load
var form1; // global
function shortCut()
{ form1=window.document.myform;
}
// -------------
// you need error handling here to cover alpha characters
// and numbers >12 and <1
//
function monthdate()
{ form1.result.value = parseInt(form1.mo.value);
}
//–>
</script>
</head>

<body onload=“shortCut()”>

<form name=“myform”>
<table border=“0” cellpadding=“0” cellspacing=“0” style=“border-collapse:collapse” width=“300”>
<tr>
<td><input type=“text” name=“mo” value=“9” SIZE=“4”></td>
<td>
<input type=“button” name=“month” value=“Calculate month” onClick=“monthdate()”></td>
<td><input type=“text” name=“result” size=“5”></td>
</tr>
</table>
</form>

</body>

</html>

Please ignore the form there are errors.