关于验证表单

我验证表单的信息,为什么单选项不能验证呢?
看下面代码,结果是无论我选择还是不选择,都是没有什么反应!

 1<script language="javascript">   
 2function check_input()   
 3{   
 4errfound=false;   
 5name = document.ffm.name;   
 6***= document.ffm.***;   
 7if (document.ffm.***.value=="")   
 8{ alert("选择性别!");   
 9return(false);}   
10return true;   
11}   
12</script>
1<form action="aaddress.asp" method="post" name="ffm" onsubmit="return check_input()">
2<p>性别   
3<input name="***" type="radio" value="man"/>男   
4<input name="***" type="radio" value="female"/>女   
5<input name="Submit" type="submit" value="提交"/>
6<input name="Submit2" type="reset" value="重写"/>
7</p></form>

---------------------------------------------------------------

document.ffm..value->document.ffm..checked==true
---------------------------------------------------------------

你把它设置一个默认值就行了。
验证的代码也是要耗网络时间的。。。。
---------------------------------------------------------------

1<input checked="" name="***" type="radio" value="man"/>

1<input name="***" type="radio" value="female"/>

Published At
Categories with Web编程
Tagged with
comments powered by Disqus