Write a JavaScript program check Data Validations?
Program: <html> <head> <title>Data Validation</title> </head> <body align="center...

https://www.computersprofessor.com/2016/06/write-javascript-program-check-data.html
Program:
<html>
<head>
<title>Data Validation</title>
</head>
<body align="center">
<form method="post" value="true" onSubmit=" Validate()">
<table border="0">
<tr>
<th>Your Name</th>
<td><input type="text" length="24"></td>
</tr>
<tr>
<th>Your Age</th>
<td><input type="text" size="3" maxlength="3">
</td>
</tr>
<tr>
<td><input type="submit" value="submit"</td>
<td><input type="reset" value="Reset"</td>
</tr>
</table>
</form>
<script language="javascript">
function Validate()
{
var valid=false;
var name=document.forms[0].elements[0].value;
var age=document.forms[0].elements[1].value;
name_re=new RegExp("^[A-Z a-z]" ,"g");
age_re=new RegExp("^[\\d]+$","g");
if(name.match(name_re))
{
if(age.match(age_re))
{
valid=true;
alert("data valid");
}
else
{
alert("Age dose not match" +age_re);
alert("Data invalid");
}
}
else
{
alert("name does not match" + name_re);
alert("Data invalid");
}
return valid;
}
< /script >
< /body >
< /html >
Out Put: