The tutorial that I'm referencing is located here:  
http://tutorial473.easycfm.com
There are many posts of this all over the internet it seems, with
slight variations, but this one makes most sense to me.

Where it's not working is where it's checking to see if the variable
has been passed to the cfm page.  The variable never exists no matter
what I try.  <CFIF IsDefined("FORM.SearchCriteria")>  It's supposed to
simply pass what you type in the textbox with the name of the variable
being the name attribute of the textbox.  Does not work.

Here is the exact code that I'm using, pasted below.  First is the
search code (I won't include the entire page as we don't need it),
second is the CF page that basically only displays ALL results because
the "SearchCriteria" variable doesn't get passed for some reason.

Thanks so much in advance for all your help!

Jeff W!


SEARCH PAGE CODE

<FORM NAME="SearchForm" ACTION="Contacts.cfm" METHOD="Post"
TARGET="DataFrame">
<TABLE CELLSPACING="0" CELLPADDING="0">
        <CFOUTPUT>
        <TR>
                <TD>&nbsp;&nbsp;<INPUT CLASS="textbox" TYPE="Text" 
ID="SearchData"
NAME="SearchCriteria" SIZE="32" VALUE="<CFIF Session.SearchCriteria IS
"">Contact Search<CFELSE>#Session.SearchCriteria#</CFIF>" onBlur="if
(this.value == '') this.value='Contact Search'" onFocus="if
(this.value ==
'Contact Search') this.value=''" AUTOCOMPLETE="Off">
                <DIV ID="Search_Choices" CLASS="autocomplete"></DIV>
                <SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript">
                        var myAutoCompleter = new 
Ajax.Autocompleter('SearchData',
'Search_Choices', 'Suggest.cfm', {});
                </SCRIPT></TD>
        </TR>
        </CFOUTPUT>
</TABLE>
</FORM>


CODE FOR THE CF PAGE

<CFIF IsDefined("FORM.SearchCriteria")>
        <CFSET name_parameter="#FORM.SearchCriteria#">
<CFELSE>
        <CFSET name_parameter="">
</CFIF>

<!--- Get Contacts search suggestion --->
<CFQUERY NAME="GetContactSuggestions" DATASOURCE="#Application.DSN#"
MAXROWS="4">
        SELECT ContactID, ContactName, FirstName
        FROM Contacts
        WHERE MasterClientID = #Session.MasterClientID# AND BookID =
#Session.AddressBook# AND Hidden = '#Session.ABViewHidden#' AND
ContactName
Like '#name_parameter#%'
        ORDER BY ContactName, FirstName
</CFQUERY>

<ul>
  <cfoutput query="GetContactSuggestions">
      <li>#ContactName#, #FirstName#</li>
  </cfoutput>
  <cfif GetContactSuggestions.RECORDCOUNT EQ 4>
      <li>...more (refine search)</li>
  </cfif>
</ul>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to