Multiple Selection Box Problem

Results 1 to 3 of 3

Thread: Multiple Selection Box Problem

  1. #1
    James Barrett Guest

    Default Multiple Selection Box Problem

    Hi all,<BR><BR>I have created an ASP form that reads and writes data to an SQL DB. The problem that I&#039m having is this:<BR><BR>I have 3 multiple select boxes on the form. I have an Edit page to update the records but I can&#039t find a way to have the Multiple Selection Box populated with the data from the DB when you come to edit the record.<BR><BR>I.E. You created a record, say - you choose 3 colours from a multiple selection box and you submit the form, no problem. You then decide you want to change the 3 colours you selected so you go to the edit page but the Multiple Selection Box does not highlight the previous seletions you made.<BR><BR>Sorry for the long winded style of this message.<BR><BR>TIA<BR><BR>James <BR> <BR><BR> <BR>

  2. #2
    Neil Popham Guest

    Default RE: Multiple Selection Box Problem

    on the amend form, call the record to amend into the recordset objRec, then:<BR><BR>&#060;select name="Colour" size="1"&#062;<BR>&#060;option value="Red" &#060;%If objRec("Colour")="Red" Then Response.Write "selected"%&#062;&#062;Red&#060;/option&#062;<BR>&#060;option value="Green" &#060;%If objRec("Colour")="Green" Then Response.Write "selected"%&#062;&#062;Green&#060;/option&#062;<BR>&#060;option value="Blue" &#060;%If objRec("Colour")="Blue" Then Response.Write "selected"%&#062;&#062;Blue&#060;/option&#062;<BR>&#060;/select&#062;<BR><BR>kinda looks ugly but it&#039s the only way i know how (unless you dynamically build your option list from an array - but this seems pointless with a 3-choice option)

  3. #3
    Neil (again) Guest

    Default RE: Multiple Selection Box Problem

    im sorry, it appears i read your query wrong.<BR><BR>i see you are using a MULTIPLE selection box.<BR><BR>i&#039m sure the solution will be quite similar, but i think we may need to know how you STORE the results in your database first, before we may suggest how you EXTRACT them.

Posting Permissions

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