Link to home
Start Free TrialLog in
Avatar of Panos
PanosFlag for Germany

asked on

cfdiv bind problem

Hello experts
Using <cfdiv bind from this solution:https://www.experts-exchange.com/questions/23826174/get-Recordcount-with-script.html
i get the recorcount without submitting my search form.
Now i have a problem trying to get the recordcount when i select hersteller_ID.
I have an error:http: Error retrieving markup for element theDiv : Error Executing Database Query.
but when i submit the form i get the result i want in my result page where i have the same query.
Here is the code that has the problem:
<cfinvoke component="test.com.getsearchmodell" method="getHersteller" returnvariable="qHersteller">
</cfinvoke>
<script type="text/javascript" src="../js/engine_micro.js"></script>
<script language="javascript" type="text/javascript">
function getModell(ID){
 //set the params required for your function
 if (isNaN(ID) || ID <= 0) ID = 0;
 var param = 'herstellerid='+ID;
 http('POST','../com/getsearchmodell.cfc?method=getMenu',showModell_response,param);
}
function showModell_response(obj){
 var mySelect = document.getElementById('S_Modell_ID');
 mySelect.options.length = 0;
 for (var c = 0; c < obj.modell_id.length; c++)
 {
  //note that jsmx calls always return lower case
  mySelect.options[c] = new Option(obj.modell_de[c] , obj.modell_id[c]);
 }      
}
</script>

<cfform>
<cfdiv bind="url:../resultscheck.cfm?S_Hersteller_ID={S_Hersteller_ID}" ID="theDiv" style="height:20px; width:80px;"/>
<cfselect name="S_Hersteller_ID" class="selectleftbig" id="S_Hersteller_ID" onchange="getModell(this.value);">
                       <option value="">beliebig</option>
                         <cfoutput query="qHersteller">
                                <option value="#qHersteller.Hersteller_ID#" >#qHersteller.Hersteller_Text#</option>
                             </cfoutput>
                           </cfselect>
<cfform>

resultscheck:
<cfquery name="WADAdboartikel" datasource="carfree24">
SELECT  Herstellers_ID
FROM artikel
WHERE (0=0
<cfif isdefined("Url.S_Hersteller_ID")>
    <cfif Url.S_Hersteller_ID NEQ "">
 AND  a.Herstellers_ID = <cfqueryparam value="#URL.S_Hersteller_ID#" cfsqltype="cf_sql_integer">
      </cfif>
  </cfif>  
     )
</cfquery>
 
<cfoutput>#WADAdboartikel.RecordCount#</cfoutput>
SOLUTION
Avatar of azadisaryev
azadisaryev
Flag of Hong Kong image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
i have totally missed that...
but i am glad i could help you find the problem!

Azadi