Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Newbie question - Refreshing Dropdowns 1

Status
Not open for further replies.

MadJock

Programmer
May 25, 2001
318
GB
I currently have the code (this is a cut down version!):

---------------------------------------------------------
<html>
<head>
<%
public sub getManagers()
strSQL = &quot;SELECT PayNo, ManagerName FROM tblManager&quot;
Set rs = Conn.Execute(strSQL)
Do while not rs.eof
Response.write &quot;<option value='&quot; & rs(&quot;PayNo&quot;) & &quot;'>&quot;
Response.write rs(&quot;ManagerName&quot;)
Response.write &quot;</option>&quot;
rs.MoveNext
Loop
rs.close
set rs=nothing
end sub
%>
</head>

<body>
<!-- Missing Stuff Here-->

<%
Set Conn = Server.CreateObject(&quot;ADODB.Connection&quot;)
MdbFilePath = Server.MapPath(&quot;RECON2000.mdb&quot;)
strSQL2 = &quot;&quot;
strSource=&quot;Provider=Microsoft.Jet.OLEDB.4.0;Password=;User ID=Admin;Data Source=&quot; & _
mdbFilePath & &quot;;Persist Security Info=True&quot;
Conn.open strSource
%>

<form action=&quot;dropdown5.asp&quot; method=&quot;post&quot;>
<table border=&quot;1&quot; width=&quot;100%&quot;>
<tr>
<td width=&quot;25%&quot;>Agent Name</td>
<td width=&quot;25%&quot;><input type=&quot;text&quot; name=&quot;txtAgent&quot; size=&quot;20&quot;></td>
<td width=&quot;25%&quot;>Manager Name</td>
<td width=&quot;25%&quot;><select size=&quot;1&quot; name=&quot;cboManager&quot;>
<% getManagers %>
</select>
</td>
</tr>
</table>
</form>
----------------------------------------------------------

I have a subroutine (the same as getManagers in structure) called getCallType() that populates a drop-down called cboCallType.

I would like to have some method of re-populating the cboCalltype whenever cboManager is changed.

I have tried using -- onChange=&quot;<%getCallType%>&quot; attached to the cboManager drop-down. However this has the effect of adding what I would like to see in cboCallType into cboManager.

Hopefully I'm not to far off track, but think that perhaps I am unsure where VBScript ends and ASP begins in the above (eg is my subrouting written in VB Script, Written in VBScript but implemented as ASP, written in ASP??!!).

Hope this makes sense

Thanks in advance for any suggestions

Graeme
 
What you're going to need to do is submit the form in order to get the value of the select list...

onChange=<%%>

Does not work, since server side script is executed BEFORE any client side script.

Here's a good FAQ on communicating between client and server side script. It will get you on your way:

faq329-603

:)
paul
penny.gif
penny.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top