wheelshot
09-19-2005, 09:41 AM
I have a Treeview and within, there are input buttons. On click i would like to launch a function that will fill an HTML table. It keeps telling me that an object is required but im not good enough to debug yet :(
Here's the place where the call is made:
Out("<li "& strStyle &" class=file><input type=""button"" value=""" & Node.Text & """ onClick=""FillTable(" & Node.ID & ")""> - <a class=treeview href=""" & Node.Href & """ target=""" & Node.Target & """ title=""" & Node.ToolTipText & """>Info</a>")
Here's my function: in VBScript
Public Sub FillTable(nodeID)
Dim Conn
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open strConn
Dim RS, parentid
Set RS = Conn.Execute("SELECT * FROM Mats WHERE ParentID=" & nodeID & " ORDER BY Text")
If Not RS.EOF Then
Do While Not RS.EOF
parentid=RS("ParentID")
RS.MoveNext
Loop
RS.Close
End If
Set RS = Nothing
Conn.Close
Set Conn = Nothing
End Sub
Thanks for your help
Here's the place where the call is made:
Out("<li "& strStyle &" class=file><input type=""button"" value=""" & Node.Text & """ onClick=""FillTable(" & Node.ID & ")""> - <a class=treeview href=""" & Node.Href & """ target=""" & Node.Target & """ title=""" & Node.ToolTipText & """>Info</a>")
Here's my function: in VBScript
Public Sub FillTable(nodeID)
Dim Conn
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open strConn
Dim RS, parentid
Set RS = Conn.Execute("SELECT * FROM Mats WHERE ParentID=" & nodeID & " ORDER BY Text")
If Not RS.EOF Then
Do While Not RS.EOF
parentid=RS("ParentID")
RS.MoveNext
Loop
RS.Close
End If
Set RS = Nothing
Conn.Close
Set Conn = Nothing
End Sub
Thanks for your help