I have a form with dropdown box that is not selecting content from my
access table. I have another text form box that is working just fine
with the same table. They should be selecting information from two
different columns on the table. If any one has an idea about the cause
please let know.
I am including my code:
<cfinclude template="Connections/Record_Search.cfm">
<cfparam name="BusinessType" default="%">
<cfparam name="Recordset1__rqSearch" default="#BusinessType#">
<cfquery name="Recordset1" datasource=#MM_Record_Search_DSN#
username=#MM_Record_Search_USERNAME# password=#MM_Record_Search_PASSWORD#>
SELECT * FROM Members WHERE BusinessType LIKE '%#Recordset1__rqSearch#%'
ORDER BY BusinessType
ASC
</cfquery>
<cfset Recordset1_NumRows = 0>
<cfset Recordset1_Index = 1>
<cfscript>
Repeat1_NumRows = 20;
Recordset1_NumRows = Recordset1_NumRows + Repeat1_NumRows;
</cfscript>
<cfscript>
// *** Recordset Stats, Move To Record, and Go To Record: set stats
variables
// set the record count
Recordset1_total = Recordset1.RecordCount;
// set the number of rows displayed on this page
If (Recordset1_NumRows LT 0 OR Recordset1_NumRows GTE Recordset1_total) {
Recordset1_NumRows = Recordset1_total;
} Else If (Recordset1_NumRows EQ 0) {
Recordset1_NumRows = 1;
}
// set the first and last displayed record
Recordset1_first = Min(1, Recordset1_total);
Recordset1_last = Min(Recordset1_NumRows, Recordset1_total);
</cfscript>
<cfscript> MM_paramName = "";
</cfscript>
<cfscript>
// *** Move To Record and Go To Record: declare variables
MM_rs = Recordset1;
MM_rsCount = Recordset1_total;
MM_size = Recordset1_NumRows;
MM_uniqueCol = "";
MM_paramName = "";
MM_offset = 1;
MM_atTotal = false;
MM_paramIsDefined = false;
If (MM_paramName NEQ "") MM_paramIsDefined = IsDefined(MM_paramName);
</cfscript>
<cfscript>
// *** Move To Record: handle 'index' or 'offset' parameter
If (NOT MM_paramIsDefined AND MM_rsCount NEQ 0) {
// use index parameter if defined, otherwise use offset parameter
If (IsDefined("index")) {
MM_offset = index;
} Else If (IsDefined("offset")) {
MM_offset = offset;
}
// check if we are past the end of the recordset
If (MM_offset GT MM_rsCount OR MM_offset EQ 0) { // past end or
move last
If ((MM_rsCount MOD MM_size) NEQ 0) { // last page not a full
repeat region
MM_offset = MM_rsCount - (MM_rsCount MOD MM_size) + 1;
} Else {
MM_offset = MM_rsCount - MM_size + 1;
}
}
}
</cfscript>
<cfscript>
// *** Move To Record: replace the current query, for navigation on a
detail page
If (MM_size EQ 1) { // if no repeated regions are defined
// create a new query with one row
MM_newQuery = QueryNew(MM_rs.ColumnList);
QueryAddRow(MM_newQuery, 1);
// copy the data in the row pointed to by MM_offset to the new query
MM_columns = ListToArray(MM_rs.ColumnList,",");
For (i=1; i LTE ArrayLen(MM_columns); i=i+1) {
QuerySetCell(MM_newQuery, MM_columns[i],
MM_rs[MM_columns[i]][MM_offset], 1);
}
// change the recordset to be only this one row
Recordset1 = MM_newQuery;
}
</cfscript>
<cfscript>
// *** Move To Record: update recordset stats
// set the first and last displayed record
Recordset1_first = Min(MM_offset, MM_rsCount);
Recordset1_last = Min(MM_offset + MM_size - 1, MM_rsCount);
// set the starting index for repeated regions on this recordset
Recordset1_Index = MM_offset;
// set the boolean used by hide region to check if we are on the last record
MM_atTotal = (MM_offset + MM_size - 1 GTE MM_rsCount);
</cfscript>
<cfscript>
// *** Go To Record and Move To Record: create strings for maintaining
URL and Form parameters
// create the list of parameters which should not be maintained
MM_removeList = "&index=";
If (MM_paramName NEQ "") MM_removeList = MM_removeList & "&" &
MM_paramName & "=";
MM_keepURL=""; MM_keepForm=""; MM_keepBoth=""; MM_keepNone="";
// add the existing URL parameters to the MM_keepURL string
MM_params=ListToArray(CGI.QUERY_STRING,"&");
For (i=1; i LTE ArrayLen(MM_params); i=i+1) {
If (FindNoCase("&" & GetToken(MM_params[i],1,"=") & "=",MM_removeList)
Is 0)
MM_keepURL = MM_keepURL & "&" & MM_params[i];
}
// add the existing Form variables to the MM_keepForm string
If (IsDefined("FORM.FieldNames")) {
MM_params=ListToArray(FORM.FieldNames,",");
For (i=1; i LTE ArrayLen(MM_params); i=i+1) {
If (FindNoCase("&" & MM_params[i] & "=",MM_removeList) Is 0)
MM_keepForm = MM_keepForm & "&" & LCase(MM_params[i]) & "=" &
URLEncodedFormat(Evaluate("FORM." & MM_params[i]));
}
}
// create the Form + URL string and remove the intial '&' from each of
the strings
MM_keepBoth = MM_keepURL & MM_keepForm;
If (MM_keepURL NEQ "") MM_keepURL = RemoveChars(MM_keepURL,1,1);
If (MM_keepForm NEQ "") MM_keepForm = RemoveChars(MM_keepForm,1,1);
If (MM_keepBoth NEQ "") MM_keepBoth = RemoveChars(MM_keepBoth,1,1);
</cfscript>
<cfscript>
// *** Move To Record: set the strings for the first, last, next, and
previous links
MM_keepMove = MM_keepBoth;
MM_moveParam = "index";
// if the page has a repeated region, remove 'offset' from the
maintained parameters
if (MM_size GT 1) {
MM_moveParam = "offset";
MM_params = ListToArray(MM_keepMove,"&");
MM_keepMove = "";
For (i=1; i LTE ArrayLen(MM_params); i=i+1) {
If (CompareNoCase(GetToken(MM_params[i],1,"="),MM_moveParam) IS NOT 0) {
MM_keepMove = MM_keepMove & "&" & MM_params[i];
}
}
If (MM_keepMove NEQ "") {
MM_keepMove = RemoveChars(MM_keepMove,1,1);
}
}
// set the strings for the move to links
if (MM_keepMove NEQ "") MM_keepMove = MM_keepMove & "&";
urlStr = CGI.SCRIPT_NAME & "?" & MM_keepMove & MM_moveParam & "=";
MM_moveFirst = urlStr & "1";
MM_moveLast = urlStr & "0";
MM_moveNext = urlStr & (MM_offset + MM_size);
MM_movePrev = urlStr & Max(MM_offset-MM_size,1);
</cfscript>
Selection Box:
<FORM name="form2" method="post"
action="../../members/directoryresultsbr.cfm">
<h2 align="left"><span class="style18 style31">Browse by
Category:</span><font face="Arial, Helvetica, sans-serif">
<select name="select">
<option value="Accountants">Accountants</option>
<option value="Auto Services">Auto Services</option>
<option value="Auto Repair">Auto Repair</option>
</select>
<INPUT type="button" name="go" value="Go!">
</FORM>
Thank you so much for any insight!
JT
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j
Archive:
http://www.houseoffusion.com/groups/CF-Newbie/message.cfm/messageid:3932
Subscription: http://www.houseoffusion.com/groups/CF-Newbie/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15