• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Question about multiple selection list

New Here ,
Apr 16, 2009 Apr 16, 2009

Copy link to clipboard

Copied

I can choose more than one item in my list by using the control key and then clicking on the items. The data is successfully stored in the SQL database separated by commas.  If I then want to display the data to the user in the same list format, it doesn't highlight the selected items. I can of course show the selections in a text box, but that defeats the purpose of the list display since I would like users to be able to make changes to the list - and then do an update for example.  Any suggestions? Is this supposed to work?

TOPICS
Server side applications

Views

559

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 17, 2009 Apr 17, 2009

Copy link to clipboard

Copied

Which server-side language are you using?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 17, 2009 Apr 17, 2009

Copy link to clipboard

Copied

I am using asp files with VB script - but so far have only used dreamweaver tools from the design interface. Do I need to create my own vb script to do this? if so, can you please give me a hint as to how to do it.  Thanks

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 17, 2009 Apr 17, 2009

Copy link to clipboard

Copied

If it were PHP, I could help, but my knowledge of ASP is minimal.

Dreamweaver server behaviors can't do this for you. Basically, what you need to do is this:

  • The result from your database will be a comma-separated string containing the selected values.
  • You need to split that string into an array of individual values.
  • For each <option> tag, you check the values in the array against the current value. If there's a match, you insert selected="selected" into the <option> tag.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 17, 2009 Apr 17, 2009

Copy link to clipboard

Copied

LATEST

Hi David,

Thank you very much for describing the solution. I have a tiny bit of experience with asp coding and will try to implement your suggestion.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines