Hi
I've got two drop down lists in a form. One is for teamleaders and one is for the agents (members) of each team. I need the agent drop down to read in a recordset of agents according to the teamleader that has been selected. At present I've got different recordsets for each teamleader, but can't quite work out the VBScript syntax.
This is what i have for the agent drop down at the moment:
<select name="agent" style="width: 150px" id="agent" title="<%=(Academy_Agent_Recordset.Fields.Item("agent").Value)%>">
--------------not sure about this next line--------------------
<% If (document.form1.teamleader.value = "Academy") Then
While (NOT Academy_Agent_Recordset.EOF)
%>
<option value="<%=(Academy_Agent_Recordset.Fields.Item("agent").Value)%>"><%=(Academy_Agent_Recordset.Fields.Item("agent").Value)%></option>
<%
Academy_Agent_Recordset.MoveNext()
Wend
If (Academy_Agent_Recordset.CursorType > 0) Then
Academy_Agent_Recordset.MoveFirst
Else
Academy_Agent_Recordset.Requery
End If
'end of first if
End If
%>
</select>
I'm trying to read in the academy_agent_recordset when 'Academy' has been selected on the teamleader drop down. I think my first If statement is incorrect. I know how to write it in Javascript, but want to do it all in VBScript.
I hope this makes sense!
Thanks in advance.
I've got two drop down lists in a form. One is for teamleaders and one is for the agents (members) of each team. I need the agent drop down to read in a recordset of agents according to the teamleader that has been selected. At present I've got different recordsets for each teamleader, but can't quite work out the VBScript syntax.
This is what i have for the agent drop down at the moment:
<select name="agent" style="width: 150px" id="agent" title="<%=(Academy_Agent_Recordset.Fields.Item("agent").Value)%>">
--------------not sure about this next line--------------------
<% If (document.form1.teamleader.value = "Academy") Then
While (NOT Academy_Agent_Recordset.EOF)
%>
<option value="<%=(Academy_Agent_Recordset.Fields.Item("agent").Value)%>"><%=(Academy_Agent_Recordset.Fields.Item("agent").Value)%></option>
<%
Academy_Agent_Recordset.MoveNext()
Wend
If (Academy_Agent_Recordset.CursorType > 0) Then
Academy_Agent_Recordset.MoveFirst
Else
Academy_Agent_Recordset.Requery
End If
'end of first if
End If
%>
</select>
I'm trying to read in the academy_agent_recordset when 'Academy' has been selected on the teamleader drop down. I think my first If statement is incorrect. I know how to write it in Javascript, but want to do it all in VBScript.
I hope this makes sense!
Thanks in advance.