I'm trying to figure out what Adobe Coldfusion is and how to work on this platform.
I am stuck in a simple problem.
On submitting, I submit the form with jQuery ajax to the server. But I got the answer: 500 (the MY_VAR element is undefined in FORM.)
What am I doing wrong?
Js
$loginForm.on('submit', function(e) {
e.preventDefault();
var formData = new FormData(e.target);
$.ajax({
url: 'test.cfm',
method: 'POST',
cache: false,
processData: false,
data: formData,
error: function(err) {
console.log(err);
},
success: function(data, status) {
console.log(status);
console.log(data);
}
});
});
CF
<cfoutput>
<p>
</cfoutput>
source
share