problem to post data

problem to post data

am 18.04.2007 07:15:04 von vinodkus

HV TAKEN A DRON DOWN AND FETCH RECORD OF THREE COLUMN FROM A TABLE,
AND I HAVE TAKEN A SUBMIT BUTTON.JUST I WANT TO SHOW ALL RECORD IN
NEXT PAGE JUST SPLIT THEM AND STORIN IN AN ARRAY BUT IT GIVES AN
ERROR

IT HAS TWO PAGES

FIRST PAGE check1.asp








New Page 1







SECOND PAGE check2.asp







New Page 1



<%
drp = Request.Form("drp1")
'Response.write(drp)
x = split(drp,";")
response.write(x(0))
response.write(x(1))
response.write(x(2))

%>





Error Type:
Microsoft VBScript runtime (0x800A0009)
Subscript out of range: '[number: 1]'
/sspharmasoft/softadmin/MISREPORTS/check2.asp, line 16

Re: problem to post data

am 18.04.2007 13:36:47 von Daniel Crichton

vinodkus@gmail.com wrote on 17 Apr 2007 22:15:04 -0700:

> HV TAKEN A DRON DOWN AND FETCH RECORD OF THREE COLUMN FROM A TABLE,
> AND I HAVE TAKEN A SUBMIT BUTTON.JUST I WANT TO SHOW ALL RECORD IN
> NEXT PAGE JUST SPLIT THEM AND STORIN IN AN ARRAY BUT IT GIVES AN
> ERROR
>
> IT HAS TWO PAGES
>
> FIRST PAGE check1.asp
>
>
>
>
>
>
>
>
> New Page 1
>
>
>
>
>
>
>
> SECOND PAGE check2.asp
>
>
>
>
>
>
>
> New Page 1
>
>
>
> <%
> drp = Request.Form("drp1")
> 'Response.write(drp)
> x = split(drp,";")

At this point you should be checking that the array is the correct size
before trying to print out the data, eg.

If IsArray(x) Then
If UBound(x) = 2 Then
response.write(x(0))
response.write(x(1))
response.write(x(2))
End If
End If

> %>
>
>
>
>
>
> Error Type:
> Microsoft VBScript runtime (0x800A0009)
> Subscript out of range: '[number: 1]'
> /sspharmasoft/softadmin/MISREPORTS/check2.asp, line 16

This error suggest that there are no semicolons in the drp1 value, probably
because there is a space in the first value which due to you not putting
quotes around the value in the OPTION element resulted in only the first
part of the data being passed back to check2.asp.

Dan