Hello, everyone,
I have a form (NOT a CFFORM - those are evil) that I am attempting to submit the data to a CFC.
Right now, all the CFC is supposed to do (for testing purposes) is to display the form data in a DIV on the same page as the form.
Every time I submit the data, I get a 500 error message stating that the page cannot be displayed.
Here is pseudo-code for what I've got, now.
<form name="subOpp" id="subOpp" enctype="application/x-www-form-urlencoded"> <!--- a couple of inputs, shortened for brevity ---> <input type="text" name="company_name" id="company_name" /> <input type="text" name="company_address" id="company_address" /> ... <input type="button" name="submitBtn" id="submitBtn" value="Submit" onclick="submitForm(this.form,'so');" /></form>
<script type="text/javascript"> function submitForm(formObj,whichForm){ XHR = new XMLHttpRequest(); XHR.open("post","../../components/public.cfc?method=submitData",true); XHR.setRequestHeader("Content-type","application/x-www-form-urlencoded"); XHR.onreadystatechange = function(){ if(XHR.readyState === 4) && (XHR.status === 200){ document.getElementById('result').innerHTML = XHR.responseText; } } XHR.send(formObj); }</script>
<cfcomponent> <cffunction name="submitData" output="yes" returntype="any"> <cfargument name="form" type="struct" required="yes" /> <cfreturn "HEY!" /> </cffunction></cfcomponent>
Firebug is showing:
POST http://localhost/public/components/public.cfc?method=submitData 500 Internal Server Error
The page you are trying to access cannot be displayed. Please try again or notify the administrator.
Am I missing a step??
V/r,
^_^