ListBox db values

Results 1 to 2 of 2

Thread: ListBox db values

  1. #1
    Join Date
    Dec 1969

    Default ListBox db values

    I am populating a listbox in vbscript and after the user makes a mistake, I come back and redisplay the form. I want the row in the listbox they selected to remain highlighted, but the listbox looks like this after the return:<BR><BR>ABC<BR>Atlanta SELECTED<BR>XYZ<BR><BR>The correct row is picked, but it&#039s not highlighted and the word SELECTED is placed next to it.<BR><BR>The following is my modified code:<BR><BR>do while not rsTrainingCenter.EOF%&#062;<BR> &#060;OPTION value="&#060;%=rsTrainingCenter.Fields("tc_unid"). Value%&#062;"&#062;&#060;%=rsTrainingCenter.Fields ("tc_Name").Value%&#062;<BR><BR>&#060;% if cint(rsTrainingCenter.Fields("tc_unid").Value) = cint(Request.Form.Item("lstTrainingCenter")) then<BR> Response.Write("SELECTED")<BR> end if<BR> rstrainingcenter.MoveNext<BR> loop<BR><BR><BR>I would appreciate any reply back that might help.<BR><BR>Bill.......

  2. #2
    Join Date
    Dec 1969

    Default RE: ListBox db values

    The word selected has to written inside of the option tag. You are writing it after the closing "&#062;" so it is outside of the option tag.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts