<!DOCTYPE html>
<html>
<head>
<script>
function numvalidate(){
var num=document.myform.num.value;
if (isNaN(num)){
document.getElementById("numloc").innerHTML="Enter Numeric value only";
return false;
}else{
return true;
}
}
</script>
</head>
<body>
<form name="myform" action="C:\Users\tejas\OneDrive\Desktop\newprogram\num_valid.html" onsubmit="return numvalidate()" >
Number: <input type="text" name="num"><span id="numloc"></span><br/>
<input type="submit" value="submit">
</form>
</body>
</html>
output
0 Comments