I have a comma delimited string that passes info from one asp page to
another. I am
using the
VBScript split function to create an array from the string.
The array returns
true when i check for it. however i'm unable to use the length property
for the
array.... i'm not sure why??
Here is the script code to create the string and it works great!
function newsSubmit() {
var strValues = "";
var boxLength = document.DeptForm.deptnum.length;
var count = 0;
if (boxLength != 0) {
for (i = 0; i < boxLength; i++) {
if (count == 0) {
strValues = document.DeptForm.deptnum.options[i].value;
}
else {
strValues = strValues + "," +
document.DeptForm.deptnum.options[i].value;
}
count++;
}
document.DeptForm.deptArray.value = strValues
document.DeptForm.submit();
Quote:
}
Here is the code to split the string and create an array. This seems to
work find it
returns true for the array.
<%
Dept = Request.Form("deptArray")
Dept = split(Dept, ",", -1, 1)
x = IsArray(Dept)
If x = "True" then
Response.Write "This is an array"
Else
Response.Write "Sorry"
End if
%>
Here is the but part... when I try to access the length of the array it
returns an error
"object required"
<%
y = Dept.length
for i = 0 to y - 1
Response.Write "News release Dept #: "%>
<%Response.Write Dept.value(i)
next
%>
Any ideas???
K