主题:  请高手捉虫!

看我的资料

职务:普通成员
等级:1
金币:0.0
发贴:81
注册:2003/5/24 12:06:05
#12004/2/18 12:39:43
<script language="VBScript" type="text/vbscript">
sub checkform()
set theform=document.form2
sss=theform("upcount").value-1
svarubmit=false
if theform.aj_name.value="" then varaj_name="案由必填!!" end if
if not isNumeric(theform.code_aj.value) or theform.code_aj.value="" then varcode="案号不得为空,且必须是数字!" end if
if theform.user_lian.value="" then varuser_lian="立案人一栏必填!" end if
for vari=0 to sss
if theform("dsr_name"&vari).value="" then vardsr_name(sss)="第"&vari+1&"号当事人的名称必填!!" end if
if theform("sex"&vari).value<>"" then
if theform("dsr_ord"&vari).value="" or theform("dsr_ord"&vari).value<=0 or theform("dsr_ord"&vari).value>120 then
         vardsr_old(sss)="第"&vari+1&"号当事人的年龄不得为空,也不得小于等于0岁或大于120岁!!"
end if
end if    
if theform("dsr_zhuzhi"&vari).value="" then vardsr_zhuzhi(sss)="第"&vari+1&"号当事人的住址没有填!!"
next
if varaj_name<>"" and varcode<>"" and varuser_lian<>"" and vardsr_name(sss)<>"" and vardsr_old(sss)<>"" and vardsr_zhuzhi(sss)<>"" then
svarubmit=true
else        
    svarubmit=false
    msgbox"警告!!"&varaj_name&varvarcode&varuser_lian&vardsr_name(sss)&vardsr_old(sss)&vardsr_zhuzhi(sss)
    end if
if svarubmit=true then
theform.submit
end if
end sub

</script>



{ 在指尖上绽放的花朵 }

职务:普通成员
等级:5
金币:14.0
发贴:3209
注册:2002/7/25 21:24:11
#22004/2/21 1:08:52
头大了…… 为什么不用javascript呢?  



看我的资料

职务:普通成员
等级:1
金币:0.0
发贴:81
注册:2003/5/24 12:06:05
#32004/2/21 11:31:55
vb要简单的多呀