中国DOS联盟论坛

中国DOS联盟

-- 联合DOS 推动DOS 发展DOS --
联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum
游客 | 登录 | 注册 | 会员 | 搜索 | 中国DOS联盟
中国DOS联盟论坛
现在时间是 2026-08-03 21:25
48,038 主题排行 / 350,123 发帖 / 今日 0 篇 / 48,251 会员排行
DOS批处理 & 脚本技术(批处理室) » [已解决]寻求获取file(i).value数值的 VBS 脚本
可打印版本  623 / 2
第1楼 zh159 发表于 2007-03-25 02:12
金牌会员 发帖 1,467 积分 3,687
[已解决]寻求获取file(i).value数值的 VBS 脚本
复选框:
<input type="checkbox" id="file1" name="file1" value="FileName1">
<input type="checkbox" id="file2" name="file2" value="FileName2">
<input type="checkbox" id="file3" name="file3" value="FileName3">
<input type="checkbox" id="file4" name="file4" value="FileName4">


要获取选中的复选框数值可用:
if file1.checked then MsgBox file1.value
if file2.checked then MsgBox file2.value
if file3.checked then MsgBox file3.value
if file4.checked then MsgBox file4.value
获取

但是如果数量大,if脚本就要跟着一样的数量(复选框是根据文件多少自动调整的)
试过
for i = 1 to Num
if file(i).checked then MsgBox file(i).value)
next
方式无效,在网上没找到何时的方法解决,询问有没有VBS方面的高手能解决?

[ Last edited by zh159 on 2007-3-24 at 04:32 PM ]
第2楼 electronixtar 发表于 2007-03-25 04:49
铂金会员 发帖 2,672 积分 7,493
提示:eval()

例如:

i=1
msgbox eval("file" & i & ".checked")

[ Last edited by electronixtar on 2007-3-25 at 05:08 AM ]
第3楼 zh159 发表于 2007-03-25 05:31
金牌会员 发帖 1,467 积分 3,687
Originally posted by electronixtar at 2007-3-24 15:49:
提示:eval()

例如:

i=1
msgbox eval("file" & i & ".checked")


搞定,多谢了
[ 联系联盟系统管理团队 - 中国DOS联盟 - 标准版 ]
Sponsored by ifanr Inc | © 2001–2023