Best of Talk (6/2/03)

 
May 29, 2003

by Dina Hess

Title: I'm Losing Client Scope
Date: 06/02/03      20 Posts
Summary: How can you maintain client state from one domain to another? Since cookies are domain specific, the solution involves passing the CFID and CFTOKEN of one domain to the other using different variable names. Step-by-step instructions are included.
 
Title: Checking Radio Buttons
Date: 06/02/03      19 Posts
Summary: If you're using CFINPUT TYPE="checkbox," you can specify a dynamic value for the CHECKED attribute by setting it as a boolean.

   <cfif some_condition>
      <cfset isChecked = true>
   <cfelse>
      <cfset isChecked = false>
   </cfif>
   <cfform .... >
      <cfinput type="checkbox" name="status"  
         value="1" checked="#isChecked#">
   </cfform>
Note that there is no need for CFOUTPUT. In MX, you can also opt to use the PRESERVEDATA attribute of CFFORM to determine a CHECKED state based on VALUE.
 
Title: If File Exists
Date: 06/02/03      12 Posts
Summary: You can check whether or not a file exists by using the FileExists function, like this:

   <cfif fileexists(absolute_filepath)>
      <cffile action="read" ...>
   <cfelse>
      That file does not exist.
   </cfif>
 
Title: A Naming '#CFFILE.ServerFile#' Question
Date: 06/02/03      13 Posts
Summary: After you've uploaded multiple files, how can you access the file names? CFFILE's status parameters are overwritten by each subsequent upload, so you will need to CFSET a variable equal to cffile.serverFile directly after each upload.
 
Title: CFLOCATION Mechanism?
Date: 06/02/03      10 Posts
Summary: Wondering how CFLOCATION works behind the scenes? CFLOCATION sends an HTTP response header to the client with an "HTTP Status" of 302, indicating the page has moved to the value specified by "Location." This thread also contains information about META refresh and CFHEADER behavior.
 

Add a Comment
(If you subscribe, any new posts to this thread will be sent to your email address.)
  
Privacy | FAQ | Site Map | About | Guidelines | Contact | Advertising | What is ColdFusion?
House of Fusion | ColdFusion Jobs | Blog of Fusion | AHP Hosting