SunQuest
           ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old July 7th, 2004, 02:54 PM
mccar2cm mccar2cm is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 13 mccar2cm User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
select box problems

I can't get this select box to be pre-populated with the values already in the database!

code
--------------------
grabs all data where taskid is 62 and grouprole is 4<br><cfdump var="#getTaskInfo#"><p></p><cfset i = 1><cfoutput query="getTaskInfo">#i# - <select name="#i#"><cfloop query="getGroups"><option value="#GroupID#" <cfif getTaskInfo.GroupID is getGroups.GroupID>SELECTED</cfif>>#GroupName#</option></cfloop></select><br><cfset i = i + 1></cfoutput>

-----------------
the result i need is
select box 1 contain the value Information Security
2 should equal IVR/Common Components
3 should be Engineering
4 should be Distributed Systems

any help would be great...thanks a lot!
Attached Images
File Type: gif Untitled-1.gif (21.6 KB, 131 views)

Reply With Quote
  #2  
Old July 7th, 2004, 06:11 PM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,627 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 10 h 8 m 55 sec
Reputation Power: 53
I'm confused, because given your query result set, you're saying that you want only one element in each of the four drop down boxes...what's the point in that?

If the result set is going to get bigger, the easiest solution would be to simply run four queries, one for each select box.
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian.
How to Post a Question in the Forums

Reply With Quote
  #3  
Old July 8th, 2004, 08:16 AM
mccar2cm mccar2cm is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 13 mccar2cm User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
sorry for not explaining it better....I want the drop down boxes populated with the values in the query "getGroups", not a problem, i can do that. but the info in the query "getTaskInfo" needs to be displayed in the select boxes as pre-selected items so the users don't mess everything up when they go back to edit something.

does that make sense?

Reply With Quote
  #4  
Old July 8th, 2004, 08:29 AM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,627 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 10 h 8 m 55 sec
Reputation Power: 53
A little, but it's still rather unclear. So you have two queries, one populates all of the drop down lists, the second one shows that you want the default selections in each of those lists to be. Is that right?

If I'm understanding corrently (which I'm still not sure of), you can probably do something like this:

Code:
<cfloop index="i" from="1" to="4">
  #i# - <select name="#i#">
  <cfoutput query="getTaskInfo">
      <option value="#GroupID#" <cfif getTaskInfo.GroupID is getGroups.GroupID[i]> SELECTED</cfif>>
    #GroupName#
    </option>
    </cfoutput>
  </select>
  <br>
</cfloop>

Reply With Quote
  #5  
Old July 8th, 2004, 09:24 AM
mccar2cm mccar2cm is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 13 mccar2cm User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
so close!!! that sort of worked but the drop downs were only populated with the values of the "getTaskInfo" query. they should be populated with the values of the "getGroups" query.

it's hard to explain things without the pointing and hand waving...thanks for humoring me.

Each Select box should be populated with the values from the "getGroups" query (all the values in the groups table) then based on the results of the "getTaskInfo" query, the correct group should be selected in the drop down based on the info in the database. i can do some more screen shots of data dumps if it will help.

Reply With Quote
  #6  
Old July 8th, 2004, 09:41 AM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,627 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 10 h 8 m 55 sec
Reputation Power: 53
In that case, try swapping the query names, like this:

Code:
<cfloop index="i" from="1" to="4">
  #i# - <select name="#i#">
  <cfoutput query="getGroups">
      <option value="#GroupID#" <cfif getTaskInfo.GroupID[i] is getGroups.GroupID> SELECTED</cfif>>
    #GroupName#
    </option>
    </cfoutput>
  </select>
  <br>
</cfloop>

Reply With Quote
  #7  
Old July 8th, 2004, 10:22 AM
mccar2cm mccar2cm is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 13 mccar2cm User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
JACKPOT! Thanks for taking the time to help me through this. I owe you big time. Thanks again!


Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > select box problems


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway