-
I have a dropdown box being populated from a database... The actual description field is the description of the product and the value is the cost...
I would like to draw both the value and the description from the dropdown to populate a database...
I am able to draw the data from a database... and I am very familiar with writing data to the database...
I just don't comprehend how to pull the description and the value of a record set that has been populated to a drop down box...
Here is a link to asp code that I am trying to build... It is very much under construction... but maybe it will help as a visual aid to give you an idea on what I am doing...
Kind Regards,
Hakan
http://www.hytech-wholesale.com/test...mbuilderw1.asp
-
In ASP, you can get the value by Request.form("ControlName"). However, that's about it. You won't be able to get the description unless you were to use some java script to put the options in some hidden fields. That'll be more complicated. I assume you have a ways to link the value to the description thru database. That means you only need to pass the value to another page and then retrieve the description based on the value from the database.
Here's a sample:
<%
if request.form("submit")="submit" then
SlctName=request.form("SlctName")
# assuming the value is an id
# process the id selected by the user here
end if
%>
<form name=testfrm method=post action="#redirect back to the same page #">
<select name=slctName>
<option value=1>banana</option>
<option value=2>apple</option>
</select>
<input type=submit name=submit value=submit>
</form>
Hope this is what you want.