Please Help!
I am trying to populate the options available in a <SELECT> control based on the user's selection of another <SELECT> control on the same form using the OnChange event. How do I either connect to my Access database query to pull a new list from within my VBScript subroutine or can I run an Active Server Page script from within the VBScript Sub? I know how to build the list, I just can't get at the data.
Here is my VBScript Sub on my .ASP page:
<script LANGUAGE="VBScript">
Sub Client_onchange()
i = 0
t_client=Document.addOpp.Client.value
'Get the new query list
'I now know that this is .ASP server side scripting, but don't know what to replace it for client side scripting
set con = Svr.CreateObject("ADODB.Connection"
con.Open("OppFilter"
set contacts2=con.Execute("qryClientContacts"
Do While Not contacts2.EOF
if (contacts2.Fields(0) = t_client) then
Document.addOpp.Contact.options.value=contact2.Fields(3)
Document.addOpp.Contact.options.text=contact2.Fields(1)
i = i + 1
end if
contacts2.MoveNext
Loop
End Sub
</script>
Thanks,
Janet
I am trying to populate the options available in a <SELECT> control based on the user's selection of another <SELECT> control on the same form using the OnChange event. How do I either connect to my Access database query to pull a new list from within my VBScript subroutine or can I run an Active Server Page script from within the VBScript Sub? I know how to build the list, I just can't get at the data.
Here is my VBScript Sub on my .ASP page:
<script LANGUAGE="VBScript">
Sub Client_onchange()
i = 0
t_client=Document.addOpp.Client.value
'Get the new query list
'I now know that this is .ASP server side scripting, but don't know what to replace it for client side scripting
set con = Svr.CreateObject("ADODB.Connection"
con.Open("OppFilter"
set contacts2=con.Execute("qryClientContacts"
Do While Not contacts2.EOF
if (contacts2.Fields(0) = t_client) then
Document.addOpp.Contact.options.value=contact2.Fields(3)
Document.addOpp.Contact.options.text=contact2.Fields(1)
i = i + 1
end if
contacts2.MoveNext
Loop
End Sub
</script>
Thanks,
Janet