I am returning a JSON from my validation CFC, which contains an array of fields that were found to be in error.
{"error":1,"fields":["first_name","email","last_name","comments"]}
I am using the jquery post method, but when I get the data returned, I cannot create the labels based on the fields in the json.
$.each(data.fields, function(){
$("#" + this + "\"").append("<label class='error' for='" + this + "'>Please check your input</label>")
But this doesn't appear to work. What am I doing wrong?
Also, I am using jquery validation plugin, but I am required to use server side validation as well. I have disabled the validator.
More info at docs :