Classic ASP display / record 2 results from database from dynamic dropdown
form list
I have a form that allocates loan computers to students. On the allocation
page form I have a dropdown that displays the list of students on our
database, but when selected records their customerID. This is needed as on
the customer information page it displays whether a loan computer has been
allocated based on the customerID.
I would like to be able to display the name of the student on the page of
loan system, but I only have the customerID. Is there a way of calling 2
lots of information (the customerID and the name, they are both in the
same database) from teh one dropdown box?
my code for the dropdown box at the moment is:
<select name="assignedto" id="assignedto"
title="<%=(RSloans.Fields.Item("loanCode").Value)%>">
<%
While (NOT rsCustomers.EOF)
%>
<option
value="<%=(rsCustomers.Fields.Item("CustomerID").Value)%>"
<%If (Not isNull((RSloans.Fields.Item("allocatedto").Value)))
Then If (CStr(rsCustomers.Fields.Item("CustomerID").Value) =
CStr((RSloans.Fields.Item("allocatedto").Value))) Then
Response.Write("selected=""selected""") : Response.Write("")%>
><%=(rsCustomers.Fields.Item("Name").Value)%></option>
<%
rsCustomers.MoveNext()
Wend
If (rsCustomers.CursorType > 0) Then
rsCustomers.MoveFirst
Else
rsCustomers.Requery
End If
%>
</select>
I'd really appreciate your help if you can. Thanks
No comments:
Post a Comment