|  | 主题:  有10项单选,每项5条选项,怎么确保每项单选都已选上 | 
            
                        
                
                    |  gation
 职务:普通成员
 等级:2
 金币:1.0
 发贴:251
 注册:2003/7/25 15:23:14
 
 | 
                            
                            #12006/5/23 11:44:44 
                                如果有人漏选了一个选项,能够alert
                                
                                
                                
                             | 
                        
                
                    |  缺缺
 职务:管理员
 等级:8
 金币:41.0
 发贴:9620
 注册:2004/1/14 19:14:47
 
 | 
                            
                            #22006/5/23 11:49:38 
                                可以在输出的时候就默认选择一个
 或者通过js遍历一下来检测
 | 
                        
                
                    |  yiliaocheng
 职务:普通成员
 等级:2
 金币:2.0
 发贴:631
 注册:2005/12/29 19:33:15
 
 | 
                            
                            #32006/5/23 11:50:39 
                                你验证每条都不为空,为空的就提示哪项为空。
                                
                                
                                
                             | 
                        
                
                    |  gation
 职务:普通成员
 等级:2
 金币:1.0
 发贴:251
 注册:2003/7/25 15:23:14
 
 | 
                            
                            #42006/5/23 14:11:09 
                                bz=0 for j=1 to 30 for i=0 to 4 if book.radiobutton(j)(i).checked=true then bz=bz+1 next if bz<30 then alert("请选择一个产品"  book.radiobutton1.focus exit function  end if 请问这样验证错在那里,是不是.radiobutton(j)的表达有误 radiobutton1,radiobutton2。。。如此命名30项单选的
                                
                                
                                
                            
                                
                                    编辑历史:[此帖最近一次被 gation 编辑过(编辑时间:2006-05-23 15:00:58)]
 
 | 
                        
                
                    |  yiliaocheng
 职务:普通成员
 等级:2
 金币:2.0
 发贴:631
 注册:2005/12/29 19:33:15
 
 | 
                            
                            #52006/5/23 17:44:11 
                                你去看看这个帖子怎么写javascrpt输入格式为2006-05-08 radiobutton(j)(i)不符合规则吧
                                
                                
                                
                             | 
                        
                
                    |  缺缺
 职务:管理员
 等级:8
 金币:41.0
 发贴:9620
 注册:2004/1/14 19:14:47
 
 | 
                            
                            #62006/5/24 9:07:05 
                                gation在上个帖子中说 引用:bz=0
 for j=1 to 30
 for i=0 to 4
 if book.radiobutton(j)(i).checked=true then bz=bz+1
 next
 if bz<30 then
 alert("请选择一个产品"
  book.radiobutton1.focus
 exit function
 end if
 请问这样验证错在那里,是不是.radiobutton(j)的表达有误
 radiobutton1,radiobutton2。。。如此命名30项单选的
 
 括号是用来引用数组的. 应该是document.getElementById("radiobutton"+i) 推荐用js来做验证.
                                
                                
                                
                             |