I'm working on a drill down search for car parts. The search had been working just fine until i tried switching the order of the drop downs. Working order goes Year/Make/Model/Outlets/Length/Width i would like to change the order to Year/Make/Outlets/Model/Length/Width but it throws the error "Complex object types cannot be converted...".
I was able to switch the length and width without it throwing the error, so i'm confused that if i can switch those without error why this switch creates an error.
Thank you very much for any help on this!
Here is the code:
Original:
<form name="DropDown" method="post">
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td>
<cfoutput>
<cfquery name="get_Main_Group" datasource="DSN">
SELECT DISTINCT Year FROM MoparParts
ORDER BY Year ASC
</cfquery>
<select style="width:100px; border-color:##666666;" name="select_Main_Group" required="yes" onchange="this.form.submit()">
<option>Year</option>
<cfloop query="get_Main_Group">
<option value="#Year#" <cfif isDefined('form.select_Main_Group')>
<cfif form.select_Main_Group eq "#Year#">selected</cfif></cfif>>#Year#</option>
</cfloop>
</select>
</td>
<td>
<cfif isDefined('page.select_Main_Group')>
<cfquery name="get_Sub_Group" datasource="DSN">
SELECT DISTINCT Make
FROM MoparParts
WHERE Year = '#page.select_Main_Group#'
ORDER BY Make ASC
</cfquery>
<select style="width:100px; border-color:##666666;" name="select_Sub_Group" required="yes" onchange="this.form.submit()">
<option>Make</option>
<cfloop query="get_Sub_Group">
<option value="#Make#" <cfif isDefined('form.select_Sub_Group')>
<cfif form.select_Sub_Group eq "#Make#">selected</cfif></cfif>>#Make#</option>
</cfloop>
</select>
<cfelse>
<img style="padding-left:8px" src="images/drop_dwn_mopar_make.jpg" />
</cfif>
</td>
<td>
<cfif isDefined('page.select_Sub_Group')>
<cfquery name="get_Sub_Group_model" datasource="DSN">
SELECT DISTINCT Model
FROM MoparParts
WHERE Year = '#page.select_Main_Group#'
AND Make = '#page.select_Sub_Group#'
ORDER BY Model ASC
</cfquery>
<select style="width:100px; border-color:##666666;" name="select_Sub_Group_model" required="yes" onchange="this.form.submit()">
<option>Model</option>
<cfloop query="get_Sub_Group_model">
<option value="#Model#" <cfif isDefined('form.select_Sub_Group_model')>
<cfif form.select_Sub_Group_model eq "#Model#">selected</cfif></cfif>>#Model#</option>
</cfloop>
</select>
<cfelse>
<img style="padding-left:8px" src="images/drop_dwn_mopar_model.jpg" />
</cfif>
</td>
<td>
<cfif isDefined('page.select_Sub_Group_model')>
<cfquery name="get_Sub_Group_Outlets" datasource="DSN">
SELECT DISTINCT Outlets
FROM MoparParts
WHERE Year = '#page.select_Main_Group#'
AND Make = '#page.select_Sub_Group#'
AND Model = '#page.select_Sub_Group_model#'
ORDER BY Outlets ASC
</cfquery>
<select style="width:100px; border-color:##666666;" name="select_Sub_Group_Outlets" required="yes" onchange="this.form.submit()">
<option>Outlets</option>
<cfloop query="get_Sub_Group_Outlets">
<option value="#Outlets#" <cfif isDefined('form.select_Sub_Group_Outlets')>
<cfif form.select_Sub_Group_Outlets eq "#Outlets#">selected</cfif></cfif>>#Outlets#</option>
</cfloop>
</select>
<cfelse>
<img style="padding-left:8px" src="images/drop_dwn_mopar_outlets.jpg" />
</cfif>
</td>
<td>
<cfif isDefined('page.select_Sub_Group_Outlets')>
<cfquery name="get_Sub_Group_CoreLength" datasource="DSN">
SELECT DISTINCT CoreLength
FROM MoparParts
WHERE Year = '#page.select_Main_Group#'
AND Make = '#page.select_Sub_Group#'
AND Model = '#page.select_Sub_Group_model#'
AND Outlets = '#page.select_Sub_Group_Outlets#'
ORDER BY CoreLength ASC
</cfquery>
<select style="width:100px; border-color:##666666;" name="select_Sub_Group_CoreLength" required="yes" onchange="this.form.submit()">
<option>CoreLength</option>
<cfloop query="get_Sub_Group_CoreLength">
<option value="#CoreLength#" <cfif isDefined('form.select_Sub_Group_CoreLength')>
<cfif form.select_Sub_Group_CoreLength eq "#CoreLength#">selected</cfif></cfif>>#CoreLength#</option>
</cfloop>
</select>
<cfelse>
<img style="padding-left:8px" src="images/drop_dwn_mopar_length.jpg" />
</cfif>
</td>
<td>
<cfif isDefined('page.select_Sub_Group_CoreLength')>
<cfquery name="get_Sub_Group_CoreWidth" datasource="DSN">
SELECT DISTINCT CoreWidth
FROM MoparParts
WHERE Year = '#page.select_Main_Group#'
AND Make = '#page.select_Sub_Group#'
AND Model = '#page.select_Sub_Group_model#'
AND Outlets = '#page.select_Sub_Group_Outlets#'
AND CoreLength = '#page.select_Sub_Group_CoreLength#'
ORDER BY CoreWidth ASC
</cfquery>
<select style="width:100px; border-color:##666666;" name="select_Sub_Group_CoreWidth" required="yes" onchange="this.form.submit()">
<option>CoreWidth</option>
<cfloop query="get_Sub_Group_CoreWidth">
<option value="#CoreWidth#" <cfif isDefined('form.select_Sub_Group_CoreWidth')>
<cfif form.select_Sub_Group_CoreWidth eq "#CoreWidth#">selected</cfif></cfif>>#CoreWidth# (tank to tank)</option>
</cfloop>
</select>
<cfelse>
<img style="padding-left:8px" src="images/drop_dwn_mopar_width.jpg" />
</cfif>
</td>
</cfoutput>
</tr>
</table>
New Broken Code:
<form name="DropDown" method="post">
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td>
<cfoutput>
<cfquery name="get_Main_Group" datasource="DSN">
SELECT DISTINCT Year FROM MoparParts
ORDER BY Year ASC
</cfquery>
<select style="width:100px; border-color:##666666;" name="select_Main_Group" required="yes" onchange="this.form.submit()">
<option>Year</option>
<cfloop query="get_Main_Group">
<option value="#Year#" <cfif isDefined('form.select_Main_Group')>
<cfif form.select_Main_Group eq "#Year#">selected</cfif></cfif>>#Year#</option>
</cfloop>
</select>
</td>
<td>
<cfif isDefined('page.select_Main_Group')>
<cfquery name="get_Sub_Group" datasource="DSN">
SELECT DISTINCT Make
FROM MoparParts
WHERE Year = '#page.select_Main_Group#'
ORDER BY Make ASC
</cfquery>
<select style="width:100px; border-color:##666666;" name="select_Sub_Group" required="yes" onchange="this.form.submit()">
<option>Make</option>
<cfloop query="get_Sub_Group">
<option value="#Make#" <cfif isDefined('form.select_Sub_Group')>
<cfif form.select_Sub_Group eq "#Make#">selected</cfif></cfif>>#Make#</option>
</cfloop>
</select>
<cfelse>
<img style="padding-left:8px" src="images/drop_dwn_mopar_make.jpg" />
</cfif>
</td>
<td>
<cfif isDefined('page.select_Sub_Group')>
<cfquery name="get_Sub_Group_Outlets" datasource="DSN">
SELECT DISTINCT Outlets
FROM MoparParts
WHERE Year = '#page.select_Main_Group#'
AND Make = '#page.select_Sub_Group#'
ORDER BY Outlets ASC
</cfquery>
<select style="width:100px; border-color:##666666;" name="select_Sub_Group_Outlets" required="yes" onchange="this.form.submit()">
<option>Outlets</option>
<cfloop query="get_Sub_Group_Outlets">
<option value="#Outlets#" <cfif isDefined('form.select_Sub_Group_Outlets')>
<cfif form.select_Sub_Group_Outlets eq "#Outlets#">selected</cfif></cfif>>#Outlets#</option>
</cfloop>
</select>
<cfelse>
<img style="padding-left:8px" src="images/drop_dwn_mopar_outlets.jpg" />
</cfif>
</td>
<td>
<cfif isDefined('page.select_Sub_Group_Outlets')>
<cfquery name="get_Sub_Group_model" datasource="DSN">
SELECT DISTINCT Model
FROM MoparParts
WHERE Year = '#page.select_Main_Group#'
AND Make = '#page.select_Sub_Group#'
AND Outlets = '#get_Sub_Group_Outlets#'
ORDER BY Model ASC
</cfquery>
<select style="width:100px; border-color:##666666;" name="select_Sub_Group_model" required="yes" onchange="this.form.submit()">
<option>Model</option>
<cfloop query="get_Sub_Group_model">
<option value="#Model#" <cfif isDefined('form.select_Sub_Group_model')>
<cfif form.select_Sub_Group_model eq "#Model#">selected</cfif></cfif>>#Model#</option>
</cfloop>
</select>
<cfelse>
<img style="padding-left:8px" src="images/drop_dwn_mopar_model.jpg" />
</cfif>
</td>
<td>
<cfif isDefined('page.get_Sub_Group_model')>
<cfquery name="get_Sub_Group_CoreLength" datasource="DSN">
SELECT DISTINCT CoreLength
FROM MoparParts
WHERE Year = '#page.select_Main_Group#'
AND Make = '#page.select_Sub_Group#'
AND Model = '#page.select_Sub_Group_model#'
AND Outlets = '#page.select_Sub_Group_Outlets#'
ORDER BY CoreLength ASC
</cfquery>
<select style="width:100px; border-color:##666666;" name="select_Sub_Group_CoreLength" required="yes" onchange="this.form.submit()">
<option>CoreLength</option>
<cfloop query="get_Sub_Group_CoreLength">
<option value="#CoreLength#" <cfif isDefined('form.select_Sub_Group_CoreLength')>
<cfif form.select_Sub_Group_CoreLength eq "#CoreLength#">selected</cfif></cfif>>#CoreLength#</option>
</cfloop>
</select>
<cfelse>
<img style="padding-left:8px" src="images/drop_dwn_mopar_length.jpg" />
</cfif>
</td>
<td>
<cfif isDefined('page.select_Sub_Group_CoreLength')>
<cfquery name="get_Sub_Group_CoreWidth" datasource="DSN">
SELECT DISTINCT CoreWidth
FROM MoparParts
WHERE Year = '#page.select_Main_Group#'
AND Make = '#page.select_Sub_Group#'
AND Model = '#page.select_Sub_Group_model#'
AND Outlets = '#page.select_Sub_Group_Outlets#'
AND CoreLength = '#page.select_Sub_Group_CoreLength#'
ORDER BY CoreWidth ASC
</cfquery>
<select style="width:100px; border-color:##666666;" name="select_Sub_Group_CoreWidth" required="yes" onchange="this.form.submit()">
<option>CoreWidth</option>
<cfloop query="get_Sub_Group_CoreWidth">
<option value="#CoreWidth#" <cfif isDefined('form.select_Sub_Group_CoreWidth')>
<cfif form.select_Sub_Group_CoreWidth eq "#CoreWidth#">selected</cfif></cfif>>#CoreWidth# (tank to tank)</option>
</cfloop>
</select>
<cfelse>
<img style="padding-left:8px" src="images/drop_dwn_mopar_width.jpg" />
</cfif>
</td>
</cfoutput>
</tr>
</table>

New Topic/Question
Reply



MultiQuote





|