Listboxes and Checkboxes
I have the following code:
---
Option Explicit
Dim bValid, sErrorMsg, iListCount
Dim aList(4)
bValid = true
iListCount = 0
If Request.Form("rt").Count = 0 Then
bValid = false
sErrorMsg = "Please Select a Request Type <br /> "
Else
For iListCount = 0 To Request.Form("rt").Count
If Request.Form("rt").item(iListCount) = "on" Then
aList(iListCount) = "Checked"
End If
Next
End If
If Len(Request.Form("policynumber")) < 10 Then
bValid = false
sErrorMsg = sErrorMsg & "Enter Policy Number in Format AAA1111111 <br /> "
End If
---
When I run the code with the web page I get the error Request object, ASP 0105 (0x80004005)
An array index is out of range.
It Points to the line
If Request.Form("rt").item(iListCount) = "on" Then
At this point I'm stuck. I've tried the get method instead of post, I've tried using htmlencode, but I always get the same error.
Any Suggestions
|