如何用vbscript来判断单选按钮或多选按钮的值呢?
如何用vbscript来判断单选按钮或多选按钮的值呢?
用javascript做出来可以,但用vb怎么也不行。谁能教教我?
问题点数:20、回复次数:3Top
1 楼karma(无为MS MVP)回复于 2001-10-16 00:36:03 得分 20
<form name="frmtest">
<input type="radio" name="sing1" value="1">1<br>
<input type="radio" name="sing1" value="2">2<br>
<input type="checkbox" name="multi1" value="3">3<br>
<input type="button" value="Show Date" onclick="showData" language="vbscript">
</form>
<script language="vbscript">
sub showData()
dim ras, nloop, chks
set ras = document.frmtest.sing1
if isnumeric(ras.length) then
for nloop = 0 to ras.length -1
if ras(nloop).checked then
msgbox "checked sing1's value:" & ras(nloop).value
end if
next
else
if ras.checked then
msgbox "checked sing1's value:" & ras.value
end if
end if
set chks = document.frmtest.multi1
if chks.checked then
msgbox "checked multi1's value:" & chks.value
end if
end sub
</script>Top
2 楼hchxxzx(NET?摸到一点门槛)回复于 2001-10-16 23:52:33 得分 0
谢谢无为老兄,程序非常不错。除了给20分之外,为了表示感谢,再给20分Top
3 楼hchxxzx(NET?摸到一点门槛)回复于 2001-10-16 23:56:16 得分 0
对不起,给了20分之后,不知道在哪里追加分数。如果你知道怎么追加分数的话,告诉我一声,我再继续加分。Top




