<html>
<head>
<title >a b c d </title>
<script language="javascript">
function validate(testform){
var digits="0123456789"
var temp
if (document.testform.Name.value=="") {alert("No Name !")return false}
if (document.testform.age.value.length < 1) {alert("You have not told us your age!")return false}
if (document.testform.age.value.length <2 ) {alert("Nobody under ten can complete this form!")return false}
for (var i=0;i<document.testform.age.value.length;i++){temp=document.testform.age.value.substring(i,i+1)if (digits.indexOf(temp)==-1){alert("Invalid Age !")return false}}
return true
}
</script>
</head>
<body>
<form name="testform" onSubmit="return validate(testform)">
Name: <input size="40" name="Name">
Age: <input size="2" name="age" maxlength="2">
<input type="submit" value="Submit Form">
</form>
</body>
</html>
为啥没有反应呢 是不是哪个地方写错 了