Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > Classic ASP Basics
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 17th, 2007, 05:08 AM
Registered User
 
Join Date: Feb 2007
Location: Mumbai, , India.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to AsadRaza
Default Problem in retreiving muliti selection list


In the name of Allah the most Merciful Beneficent

I m facing problem in retreiving previously selected items in a multiselection list. Say, I selected four items from a list of 6 but when I retreive the rcords from database for updation I find only one highlighted. What I want is : all the items previously selected should be highlighted at updation.
I have tried Split and arrays but it's not working.

PLease help if any of you can,
Regards,
:D
Reply With Quote
  #2 (permalink)  
Old February 18th, 2007, 09:03 PM
Friend of Wrox
Points: 6,664, Level: 34
Points: 6,664, Level: 34 Points: 6,664, Level: 34 Points: 6,664, Level: 34
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2004
Location: Sydney, NSW, Australia.
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

May I ask you for an explanation of this statement?:
;;;In the name of Allah the most Merciful Beneficent

Re your problem:
You should be posting your problematic code. You will not get far here asking people to write code for you. Perhaps if you posted the code that resulted in this statement:

'I have tried Split and arrays but it's not working'

Someone would correct your incorrect code. Instead, here is a working example of how you would achieve this objective (cut directly from one of my working pages):

Get the master list for the select box (groups in this case):
sql = "SELECT ID,shortName FROM groups where ..."
set getInfo = conn.execute(sql)

Get the options that should be selected for a given user (userGroups has a one to many relationship with the groups table - A user can be a member of many groups):
sql = "SELECT gid from userGroups WHERE uId = " & cint(getEditInfo(0)) & ";"
set getTest = conn.execute(sql)

Here is the looping conditional multiselect box:

<% if not getInfo.EoF Then %>
       <select name="gId" style="width:151" multiple size="5">
<% do until getInfo.EoF %>
          <option value="<%= getInfo(0) %>"
          <% if edit = true then
                getTest.moveFirst
                do until getTest.Eof
                   if cint(getTest(0)) = cint(getInfo(0)) then
                      response.write " selected "
                   end if
                   getTest.moveNext
                loop
             end if%>><%= getInfo(1) %></option>
<% getInfo.moveNext
             loop
    else %>
        <I class="note">No groups found</i>
<% end if %>



Wind is your friend
Matt
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pre-filtering a selection list asearle XSLT 4 November 7th, 2006 09:24 AM
how to automate selection of items from list satish_k VB How-To 0 October 6th, 2006 06:44 AM
Data List Selection Norberto_Caraballo Beginning VB 6 1 June 24th, 2006 09:41 AM
problem in retreiving db fields in the text boxes umair_rathore Access ASP 1 February 17th, 2005 05:01 PM
Menu / Dropdown List Selection Reduction larry101 Javascript How-To 2 September 20th, 2004 03:43 AM



All times are GMT -4. The time now is 09:39 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.