0 Replies Latest reply on Oct 5, 2015 7:00 AM by bittermarshalls

    Quick question about cfdirectory and a search function

    bittermarshalls

      Hi everybody,

       

      I am a big noob in programming so here my quick question.

      I used cfdirectory to create a table that show me all my files in my directory and now I want a search function where I can search a specific filename.

       

      Example:

       

      Searchsite:

       

      Name:

      Reciver:

      Sender:

       

       

      Directory Table:

       

      Header 1
      invoice 22333444555-6667777888999
      desadv 22233345555-2222222333444
      qwop 2333333333333-444444444444
      invoice 333333333333-6667777888999

       

      Now I want to search only for invoice 22333444555-6667777888999 so that the table only contains this one file




      invoice 22333444555-6667777888999

      Name: invoice

      Reciver:22333444555

      Sender: 6667777888999


      or just


      Name: invoice

      Reciver:

      Sender: 6667777888999


      Output:

       

      Header 1
      invoice 22333444555-6667777888999
      invoice 333333333333-6667777888999

      Is this possible only with ColdFusion and is it genrelly possible in ColdFusion ?

       

       

       

      <html>

      <font face="Arial,Helvetica">

      <div style="background:

      url(http://fs5.directupload.net/images/150928/yqe7ix2v.png);

      width: fullpx;

      height: 100px;>

      <div style="right"><a href="-">

      <IMG SRC="-"

      alt="link"></div></a>

      <HR SIZE=1>

      <body

      background="http://fs5.directupload.net/images/150925/g3k8kvmr.png"

      text=#1C1C1C link=#08088A>

      </div>

       

      <head>

      <meta charset="UTF-8" />

      <title>Suche

      </title>

      </head>

      <body>

      <div id="seite" style="text-align: center">

       

       

      <div id="fussbereich">

      <cfset oldlocale = SetLocale("German (Standard)")>

      <cfoutput>#LSDateFormat(Now(), "ddd, dd mmmm, yyyy")#

      </CFOUTPUT>

      </div>

       

      </body>

      </html>

       

       

      <cfdirectory

          directory = "#ExpandPath('150903T')#"

          action= "list"

          name = "meinVerzeichnis"

          sort = "name"

          type = "all"

          >

       

       

       

      <cfform action="MultiErgebnisSeite.cfm" name="form1">

      <TABLE border="0" bordercolor="#151515" width="80%"

      background="http://fs5.directupload.net/images/150925/g3k8kvmr.png">

      <p>

      <p>

      <TD align="left"><b><b><b><b>

      Suchfunktion

      </TD>

      </p>

      </p>

      <form action="MultiErgebnisSeite.cfm" method="post">

      <tr>

      <td>Nachrichtentyp:</td>

       

       

       

      <cfdirectory

          directory = "#ExpandPath('150903T')#"

          action= "list"

          name = "meinVerzeichnis"

          sort = "name"

          type = "all"

          >

       

      <td>

      <cfinput

      type="Text"

      name="name"

      size="35"

      maxlength="50"

      autoSuggest="#valueList(meinVerzeichnis.name)#"

      typeahead="true" /></td>

       

      </tr>

      <tr>

      <td>Sender:</td>

      <td>

      <input

      type="Text"

      name="search_sender"

      size="35"

      maxlength="13"></td>

      </tr>

      <tr>

      <td>Empf&auml;nger:</td>

      <td>

      <input

      type="Text"

      name="search_receiver"

      size="35"

      maxlength="13">

      </td>

      </tr>

      <tr>

      <td> </td>

      <td>

      <input

      type="Submit"

      value="Weiter"> <input

      type="Reset"

      </cfform>

      _____________________________________

       

      <html>

      <meta charset="UTF-8" />

       

      <font face="Arial,Helvetica">

      <div style="background:

      url(http://fs5.directupload.net/images/150928/yqe7ix2v.png);

      width: fullpx;

      height: 100px;>

      <div style="right"><a href="-">

      <IMG SRC="-"

      alt="link"></div></a>

      <HR SIZE=1>

      <body

      background="http://fs5.directupload.net/images/150925/g3k8kvmr.png"

      text=#1C1C1C link=#08088A>

      </div>

       

      <cfparam name="name" default="0">

       

      <h3>cfdirectory-Test</h3>

       

      <cfdirectory

          directory = "#ExpandPath('150903T')#"

          action= "list"

          name = "meinVerzeichnis"

          sort = "name ASC"

          type = "all"

       

          >

       

      <cftable border="2"

        query="meinVerzeichnis"

        htmltable

        colheaders>

      <cfcol

      header="Name:"

      text="#Name#">

      </cftable>

       

      <form method="get" action="mdirectory2.cfm">

          <button type="submit">Zur&uuml;ck</button>

      </form>

       

       

       

       

       

       

      </html>