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>
Bookmarks