Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

select listbox 2

Status
Not open for further replies.

Albert3162

Programmer
Jul 13, 2001
18
US
Hello.
I have data in column like (Albert, John, Brenda, ...)
I need show this data as select listbox
do anybody have something like this?

Thanks.
 
Essentially:

Code:
<cfquery...name="testc">
  select * from table
</cfquery>

<cfoutput><form action="#listlast(cgi.script_name,"/")#" method="post">
  <select name="xsel">
  <cfloop query="testc">
    <option value="#DATA_COLUMN#">#DATA_COLUMN#</option>
  </cfloop>
  </select>
</form></cfoutput>

You'll have to make the revisions of specifying a datasource, changing DATA_COLUMN to a data column...

ALFII.com
---------------------
If this post answered or helped to answer your question, please reply with such so that forum members with a similar question will know to use this advice.
 
Try this:
Code:
<cfset MyList = ValueList(Query.column)>

<cfoutput>
 <select>
  <cfloop index="i" list="MyList" delimiters=",">
    <option value="#i#">#i#</option>
  </cfloop>
 </select>
</cfoutput>




Hope This Helps!

Ecobb
Beer Consumption Analyst

"My work is a game, a very serious game." - M.C. Escher
 
Man, I've got start typing faster if I want to get an answer in before webmigit or bombboy around here! [thumbsup2]



Hope This Helps!

Ecobb
Beer Consumption Analyst

"My work is a game, a very serious game." - M.C. Escher
 
No, just check TT every two seconds... That should be a skill on my resume... "I can program, act as DBA, and check forums fast."

haha...

ALFII.com
---------------------
If this post answered or helped to answer your question, please reply with such so that forum members with a similar question will know to use this advice.
 
"I can program, act as DBA, and check forums fast."
[lol]

You're Hired!



Hope This Helps!

Ecobb
Beer Consumption Analyst

"My work is a game, a very serious game." - M.C. Escher
 
I even tried to put TT in a frame to auto update every 60 seconds once, but it would break out of it. :(

webmigit sounds like your server admin too. don't forget that. :)

I wonder if that's something that TT can offer. We can be Certified TT refreshers.

Human beings, who are almost unique in having the ability to learn from the experience of others, are also remarkable for their apparent disinclination to do so.
-Douglas Adams (1952-2001)
 
Certified?

As in a certificate?

Or as in "certifiable" (calling someone crazy)..

I think both fit nicely.

ALFII.com
---------------------
If this post answered or helped to answer your question, please reply with such so that forum members with a similar question will know to use this advice.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top