by Dina Hess
| Title: | Dynamic List Generation |
| Date: | 06/10/04 (12 Posts) |
| Summary: | Trying to create a JavaScript array from a column in a query recordset? This should do it: | <cfoutput> <script type="text/javascript"> var slideurl=new Array(#listqualify(queryname.column, "'")#); </script> </cfoutput> |
| Enhancements to this basic solution are included in the thread. | |
| Related: |
Dynamic list generation - SOLVED |
| Title: | Force Download? |
| Date: | 06/10/04 (15 Posts) |
| Summary: | How can you prevent a linked image from automatically loading into the application associated with its file extension and, instead, save it or download it? Add a link, like this: |
<a href="file_download.cfm?file2download=image.tif"> PHOTO DOWNLOAD</a> | |
| Then enter this code at the top of the file_download.cfm page: | |
<cfheader name="content-disposition" value="attachment;filename=#URL.file2download#"> <cfcontent type="application/unknown" file="#physicalPathToFilesFolder##URL.file2download#"> | |
| Note that this won't work if a CFLOCATION tag is included in file_download.cfm since it's not possible to do both within the same HTTP response. | |
| Title: | Getting all Form Fields? |
| Date: | 06/10/04 (17 Posts) |
| Summary: | Need to display all FORM fields? If you want the fields to display in the order they appear on the form, loop over form.fieldnames: |
<cfloop list="#form.fieldnames#" index="field"> <b>#field#:</b> #FORM[field]#<br><br> </cfloop> | |
| But if you want the fields to display alphabetically, loop over structkeylist(FORM): | |
<cfloop list="#StructKeyList(FORM)#" index="i"> <b>#i#:</b> #FORM[i]#<br><br> </cfloop> | |