List Box and ASP


I populate a list box using a recordset. Pretty straight forward.
Its in a form that uses a combination of listboxes and text boxes.
When the user forgets essential information the form will return itself and an error message. Any information that has been entered will be passed back into the form using Request.Form("Variable") so that the user doesn't have to fill it out again.
OK, my question is how do I do this with my drop-down while still allowing the user to reselect if they made a mistake.
Who is Participating?
MasseyMConnect With a Mentor Commented:
when you are creating your SELECT items from the record set do this:

DropDown = Request("DropDown")

do while no RS.EOF
  curItem = rs("fieldname")
  response.write <OPTION VALUE=" & CurItem
  if CurItem = DropDown then response.write " SELECTED"
  response.write ">" & CurItem & "</OPTION>"

JassonAuthor Commented:
Thanks Mat.

Forgetting my html. Need to stop using Interdev and go back to notepad.

Got another one as well. See the PASSING MULTIPLE VALUES USING A DROP DOWN.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.