I just setup mxAjax and I thought I did it right-- I just want to use
it to do some asynchronous calculations using CF but not having much
luck. The form is here:
http://ah.triggerid.com/useful/index.cfm
and I have the form set to trigger the function after filling out the
3rd field. Here's the JS:
<script type='text/javascript' src='
http://ah.triggerid.com/includes/
core/js/prototype.js'></script>
<script type='text/javascript' src='
http://ah.triggerid.com/includes/
core/js/mxAjax.js'></script>
<script type='text/javascript' src='
http://ah.triggerid.com/includes/
core/js/mxData.js'></script>
<script language="javascript">
var url = "
http://ah.triggerid.com/includes/core/cf/functions.cfc";
function doMortg() {
var P=document.getElementById('P').value;
var I=document.getElementById('I').value;
var N=document.getElementById('N').value;
alert(P);
params = 'P='+P+',I='+I+',N='+N;
alert(params);
new mxAjax.Data({
executeOnLoad:true,
paramArgs: new mxAjax.Param(url,{param:params,
cffunction:"mortgagecalc"}),
postFunction: handleData
});
}
function handleData(response) {
document.getElementById('test').innerHTML =
response;
}
</script>
and right now my functions.cfc file just has this:
<cfcomponent extends="mxAjax">
<cffunction name="mortgagecalc">
<cfargument name="P" required="yes" type="string">
<cfargument name="I" required="yes" type="string">
<cfargument name="N" required="yes" type="string">
<cfset retData="hello">
<cfreturn retData>
</cffunction>
</cfcomponent>
If I use it it says it can't find the component mxajax?