View Single Post
Old 04-11-2005, 06:39 AM   #2 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,505
sde is on a distinguished road
i don't know asp well enough to type it off the top of my head, .. but here is some suedo code. mySubmittedValue will have to be set somewhere above the for loop.
Code:
<select name="Products" id="products" onChange="DescTest()">
  <%dim j
  for j=lbound(arrproducts) to ubound(arrproducts)-1
    Response.Write "<option value=" & arrproducts(j,1)

    If arrproducts(j,0)= mySubmittedVariable
      Response.Write " selected"
    End If

    Response.Write ">" & arrproducts(j,0) & "</option>"
  next
  %>
</select>
like i said, i don't know asp very well, but this is the logic i might use with PHP. ( with a lot less code )
__________________
Mike
sde is offline   Reply With Quote