To validate numbers , make a call for this function in your if condition. pass the user input (s) . hope this helps
<script type="text/javascript">
function isInteger(s)
{ var i;
for (i = 0; i < s.length; i++)
{
// Check that current character is number.
var c =...