Hi,

I'm using the following tag to list a directory structure.

<CFPARAM NAME="dir" DEFAULT="d:\">

<CFDIRECTORY ACTION="LIST" DIRECTORY="#dir#" NAME="dirlist">

I also have a <INPUT field where I can type in "*.txt" and it will list all 
of the files with a .txt extension.
When I click on the "Filter" button I have the following code in my 
index.cfm file that determines which
<CFDIRECTORY to load.


It works great except when I search for all the .txt files, it no longer 
lists the subdirectories along with the files.
I'm not sure if this is a <CFDIRECTORY problem or the rest of my code.


INDEX.CFM (has <cfinclude to mask.cfm)
----------------

<CFOUTPUT>
<CFIF ISDEFINED("maskdefined")>
                <CFDIRECTORY ACTION="LIST" DIRECTORY="#dir#" NAME="dirlist" 
FILTER="#filter#">
<CFELSE>
                <CFDIRECTORY ACTION="LIST" DIRECTORY="#dir#" NAME="dirlist">
</CFIF>
</CFOUTPUT>


MASK.CFM
---------------

<CFSET mask = "#CGI.QUERY_STRING#">

<CFIF ISDEFINED("maskdefined")>
<CFELSE>
        <CFSET filter = "">
</CFIF>

<CFOUTPUT>
<CFFORM ACTION="index.cfm?#mask#" METHOD="GET" NAME="form1">
        <TABLE WIDTH="168" CELLPADDING="0" CELLSPACING="0" BORDER="0">
        <TR>
        <TD>
        &nbsp;&nbsp;
        <CFINPUT TYPE="text" NAME="filter" VALUE="#filter#" SIZE="16" 
MAXLENGTH="20" CLASS="dirlinks">&nbsp;
        </TD>
        <TD ALIGN="right">
        <INPUT TYPE="hidden" NAME="maskdefined" VALUE="">
        <INPUT TYPE="submit" VALUE="Filter" CLASS="dirlinks">
        </TD>
        </TR>
        </TABLE>
</CFFORM>
</CFOUTPUT>






~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to