修改后的代码。
错误消息:Object required:'document.getElementsByName(...)(...)'
行:59
字符:13
错误代码:if document.getElementsByName("chk" & arrName(ii))(0).Checked then
<SCRIPT language="VBScript">
Dim arrName(),arrExe()
Set objFS = CreateObject("Scripting.FileSystemObject")
Set objFile = objFS.OpenTextFile("software/software.txt")
strSoftware = objFile.ReadAll
objFile.Close
arrSplit = Split(strSoftware, vbNewLine)
i = 0
For Each strLine in arrSplit
ReDim Preserve arrName(i + 1)
ReDim Preserve arrExe(i + 1)
arrName(i) = TRIM(Left(strLine,InStr(strLine,";")-1))
arrExe(i) = TRIM(Right(strLine,InStr(strLine,";")))
strHTML = CheckboxArea.InnerHTML
strHTML = strHTML & "<BR><INPUT TYPE='CHECKBOX' VALUE='" & arrName(i) & "' NAME ='chk'" & arrName(i) & " />" & arrName(i)
CheckboxArea.InnerHTML = strHTML
i = i + 1
Next
Sub Confirm
Dim objForm, Element
set objForm=document.forms("SoftwareSelect")
set Element=objForm.elements
i=0
ii=0
for i=0 to Element.length
if Element(i).type="checkbox" then
if document.getElementsByName("chk" & arrName(ii))(0).Checked then
MsgBox(arrName(ii) & " is checked.")
end if
ii = ii + 1
end if
next
End Sub
</SCRIPT>