streborr
IS-IT--Management
- Jan 16, 2002
- 98
I have a dropdown box populated from a db.
What I need to know is if I can have two values in the option value, one sent to one field and another sent to a different field.
Example:
User chooses from a dropdown list on a form.
I need one value (which is visible in the list) to go to the "dist_name" field and a another value (dist_number) to go to the "dist_number" field when the user hit the submit button on the form.
The code below is what I have now. The list displays distributor name and city, when chosen the value(distributor name) is submitted.
<select size="1" name="Dist">
<option value="">Select Distributor</option>
<%
Do while not rsADO.eof
Response.write "<option value='" & rsADO("dist_name"
& "'>"
Response.write rsADO("dist_name"
& " - " & rsADO("dist_city"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
Response.write "</option>"
rsADO.MoveNext
Loop
rsADO.close
set rsADO = nothing
%>
</select>
Thanks,
Rick
What I need to know is if I can have two values in the option value, one sent to one field and another sent to a different field.
Example:
User chooses from a dropdown list on a form.
I need one value (which is visible in the list) to go to the "dist_name" field and a another value (dist_number) to go to the "dist_number" field when the user hit the submit button on the form.
The code below is what I have now. The list displays distributor name and city, when chosen the value(distributor name) is submitted.
<select size="1" name="Dist">
<option value="">Select Distributor</option>
<%
Do while not rsADO.eof
Response.write "<option value='" & rsADO("dist_name"
Response.write rsADO("dist_name"
Response.write "</option>"
rsADO.MoveNext
Loop
rsADO.close
set rsADO = nothing
%>
</select>
Thanks,
Rick