I've got a freeform form that is setup to be ajax submitted. However, even though it all works and it sends an e-mail without page refresh, i don't get a json message back, it gives me a full webpage in the response.
My freeform code is like:
{exp:freeform:form
collection="Single Product Enquiry"
required=""
notify="me@me.com"
template="single_product_enquiry_form"
ajax="yes"
form:id="ajax_form"
}
and ajax code like this:
$('#ajax_form').ajaxForm(function(data) {
if(data.success === true)
{
$("#modal-action").hide();
$("#modal-reaction").show();
}
if(data.success === false)
{
//$(".form-error-holder").html("<label class='error'>"+data.errors.join(', ')+"</label><input type='text' class='error' /><small class='error'>Invalid entry</small>");
$.each(data.errors, function(i, item)
{
$(".form-error-holder").append("<small class='error'>"+i+": "+item+"</small>");
});
}
});
But i'm just not getting that json response. Any idea why?
ajax="no"
rather than just the presence of anajax
param but I suspect it's for speed of parsing. – Tom Davies Nov 28 '12 at 16:02