<!DOCTYPE html>
<html lang="en">
<head>
<script>
function isNumeric(elem, helperMsg){
var numericExpression = /^[0-9]+$/;
if(elem.value.match(numericExpression)){
return true;
}else{
alert(helperMsg);
elem.focus();
return false;
}
}
</script>
</head>
<body>
<form>
Field #1: <input type="text" id="zone1" value="5674747574"><br>
Field #2: <input type="text" id="zone2" value="222-333-333"><br>
Field #3: <input type="text" id="zone3" value="dgfthekdg"><br><br>
<input type="button" onclick="isNumeric(document.getElementById('zone1'), 'not only numeric')" value="Check Field #1"><br>
<input type="button" onclick="isNumeric(document.getElementById('zone2'), 'not only numeric')" value="Check Field #2"><br>
<input type="button" onclick="isNumeric(document.getElementById('zone3'), 'not only numeric')" value="Check Field #3">
</form>
</body>