Panos
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.getsea rchmodell" method="getHersteller" returnvariable="qHerstelle r">
</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/getsea rchmodell. 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_Hers teller_ID= {S_Herstel ler_ID}" ID="theDiv" style="height:20px; width:80px;"/>
<cfselect name="S_Hersteller_ID" class="selectleftbig" id="S_Hersteller_ID" onchange="getModell(this.v alue);">
<option value="">beliebig</option>
<cfoutput query="qHersteller">
<option value="#qHersteller.Herste ller_ID#" >#qHersteller.Hersteller_T ext#</opti on>
</cfoutput>
</cfselect>
<cfform>
resultscheck:
<cfquery name="WADAdboartikel" datasource="carfree24">
SELECT Herstellers_ID
FROM artikel
WHERE (0=0
<cfif isdefined("Url.S_Herstelle r_ID")>
<cfif Url.S_Hersteller_ID NEQ "">
AND a.Herstellers_ID = <cfqueryparam value="#URL.S_Hersteller_I D#" cfsqltype="cf_sql_integer" >
</cfif>
</cfif>
)
</cfquery>
<cfoutput>#WADAdboartikel. RecordCoun t#</cfoutp ut>
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.getsea
</cfinvoke>
<script type="text/javascript" src="../js/engine_micro.js
<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/getsea
}
function showModell_response(obj){
var mySelect = document.getElementById('S
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.
<cfselect name="S_Hersteller_ID" class="selectleftbig" id="S_Hersteller_ID" onchange="getModell(this.v
<option value="">beliebig</option>
<cfoutput query="qHersteller">
<option value="#qHersteller.Herste
</cfoutput>
</cfselect>
<cfform>
resultscheck:
<cfquery name="WADAdboartikel" datasource="carfree24">
SELECT Herstellers_ID
FROM artikel
WHERE (0=0
<cfif isdefined("Url.S_Herstelle
<cfif Url.S_Hersteller_ID NEQ "">
AND a.Herstellers_ID = <cfqueryparam value="#URL.S_Hersteller_I
</cfif>
</cfif>
)
</cfquery>
<cfoutput>#WADAdboartikel.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
but i am glad i could help you find the problem!
Azadi