Here is what I am trying to do. I have two pick list options (drop downs) and the first one pulls from a table with department names in it, these department names are also found in the PhoneBook table which the second pick list is TRYING to pull from.
Here is my issue, the first option works fine the departments display no problem. How can I change the following code to allow the Requestor field to be updated based on what the user selects in the Department field?
Basically if you pick Finance in the department field then the Requestor field should then update to show only people who work in the Finance department.
Expand|Select|Wrap|Line Numbers
- <tr>
- <td valign="center">Department</td>
- <td>
- <select name="REQUESTOR_DEPT" onChange="">
- <option value="">Choose One
- <%sql = "SELECT APP_LIST_VALUE_DESC from TICKER_APP_LIST_VALUE WHERE APP_LIST_ID = 5 ORDER BY APP_LIST_VALUE ASC "
- set rs = server.CreateObject("adodb.recordset")
- rs.Open sql, conn
- while not rs.eof
- Response.Write("<option value='"&rs(0)&"'")
- if cstr(REQUESTOR_DEPT)=cstr(rs(0)) then
- Response.Write(" selected ")
- end if
- Response.Write(">"&rs(0))
- rs.movenext
- wend
- rs.close
- set rs = nothing
- %>
- </select></td>
- <td></td>
- <td></td>
- </tr>
- <tr>
- <td valign="center">Requestor</td>
- <td><select name="PROF_ANAYLST_ID" onChange="">
- <option value="">Choose One
- <%sql = "SELECT LNAME+' '+FNAME FROM dbo_phonebook WHERE Department LIKE ' " & REQUESTOR_DEPT " '"
- set rs = server.CreateObject("adodb.recordset")
- rs.Open sql, conn2
- while not rs.eof
- Response.Write("<option value='"&rs(0)&"'")
- if cstr(PROF_ANAYLST_ID)=cstr(rs(0)) then
- Response.Write(" selected ")
- end if
- Response.Write(">"&rs(0))
- rs.movenext
- wend
- rs.close
- set rs = nothing
- %>
- </select></td>
- </tr>