i want to validate a field that require the user to insert number/integer. i have come up with this code, but this code only validate when the user did not enter anything on the field.

can someone show me how to validate a field that require the user insert integer?
<script language="JavaScript">
function Form()
{
var cpos;

with(window.document.msgform)
{
cpos =postalCode;

if(cpos.value == "")
{
alert('Please enter your postalCode.Only numbers are allowed. ');

return false;
}

Else{
Return true;
}
}
}
</script>
<body>
<form name="form" method="post" onSubmit="return form()">
PostalCode:<input name="postalCode" type="text" />
<input type="submit" name="submit" value="Submit">
</form>