hi casselj
thanks for ur response
i used ur way to get the array in client site script
that was working but still i got some problem
1. my system is getting too slow while processing the script
2 . becouse i am writing recordset values in the array and then on change of select control i want to compare the select value with the element in the array
but this comparison is not going to happen
so i am unable to solve the problem
i am sending u the part of code which i used
code is below-:
set rsvehicle=server.CreateObject("Adodb.recordset")
rsvehicle.cursorlocation=3
rsvehicle.ActiveConnection =con
sqlveh="select a.vehicleno,b.name,b.contact from vehicle_master a,driver_master b where a.facilityid="& facid & " and a.vendorid='"& vid & "' and a.driver_id=b.driver_id"
'getting vhicleno with drivername and no
set rsvehicle=con.execute(sqlveh)
If rsvehicle.EOF=false then
MyArray1=rsvehicle.GetRows()
end if
MaxCols1=ubound(MyArray1,1)
MaxRows1=ubound(MyArray1,2)
arrayname1= "NewArray1"
Response.Write("<SCR"&"IPT LANGUAGE = 'VBSCRIPT' >" &chr(13))
response.write ("Dim NewArray1(" & Maxcols1 & "," & MaxRows1 & ")"&chr(13))
for vb2jsi=0 to Maxcols1
for vb2jsj=0 to MaxRows1
vb2jsstr = "MyArray1("&vb2jsi&","&vb2jsj&")"
%>
<%=ArrayName1%>(<%=vb2jsi%>,<%=vb2jsj%>) = "<%=trim(eval(vb2jsstr))%>"
<%
Next
Next
Response.write("sub vehicleonchange(i)" & chr(13))
'getting the index of current select named vehicle in i
Response.Write("dim se" & chr(13))
Response.Write ("dim dname" & chr(13))
Response.Write ("dim dphone" & chr(13))
Response.Write (chr(13))
Response.Write ("se=document.all" & "(""vehicle"")(i).value")
' getting the value of current vehicle select
Response.Write (chr(13))
Response.Write("msgbox se"& chr(13)) ' for checking
Response.write("for vb2jsj=0 to ubound(NewArray1)"& chr(13))
Response.write("msgbox cstr(NewArray1(0,vb2jsj))" & chr(13)) ' for checking
Response.Write("msgbox cstr(se)"& chr(13)) ' for checking
Response.write("if cstr(NewArray1(0,vb2jsj))=cstr(se) then" & chr(13))
Response.Write("dname=NewArray1(1,vb2jsj)")
Response.Write (chr(13))
Response.Write("dphone=NewArray1(2,vb2jsj)")
Response.Write (chr(13))
Response.Write("end if" & chr(13))
Response.Write("next" & chr(13))
Response.write("msgbox dname" & chr(13))
Response.Write("msgbox dphone"& chr(13))
Response.write("end sub" & chr(13))
Response.Write("</SCR"&"IPT>")
|