|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
You don't need a fax machine to get faxes. Get a fax-to-email fax number from CallWave. Try it free.
|
|
#1
|
|||
|
|||
|
Hi does anybody know how to populate a list box (named which_fields) with the column names of a table from a query (named database_fields)?
I have tried various things and the best I've done is create a list box with no column names in it using this code: <cfFORM name="DateForm" ACTION="Download.cfm" METHOD="post"><div align="center"><BR> <B>Select recordset type to download:</B><BR> <select name="which_fields" display= "label" required="yes"> <cfloop list="#database_fields.ColumnList#" index="MyColumnName"> <option value="#MyColumnName#"></option></cfloop> </select> where am I going wrong??? Thanks in advance for any help |
|
#2
|
|||
|
|||
|
I notice you do not have a closing </cfform> tag at the end of the form, that may be your problem.
__________________
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 |
|
#3
|
|||
|
|||
|
Sorry to be confusing...I do have cfform end tag at the end of the code. I only gave the first bit of the code for that list box.
Do I need to but cfoutput statements some where?? So that the column names are printed to the screen. Have tried various positions for this tag but doesn't seem to work. If you have any ideas please let me know. I'll just keep battling on with it... trial and error... there must be a way to do it. Thanks |
|
#4
|
|||
|
|||
|
Here you go. This should work for you.
<cfquery name="getClients" datasource="#ds#"> SELECT * FROM clientManager </cfquery> <form name="DateForm" action="download.cfm" method="post"> <div align="center"><BR> <B>Select recordset type to download:</B><BR> <select name="which_fields" display="label" required="yes"> <cfoutput> <cfloop index="wow" list="#getClients.ColumnList#" delimiters=","> <option value="#wow#">#wow#</option> </cfloop> </cfoutput> </select> </form> |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ColdFusion Development > Populating list box with column names |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|