I changed my coding style for php and jQuery, but my Registration
$(\"#reg_form_company\").bind(\"submit\", function() {
$.fancybox.showActivity();
$.aj
You need to do something like this: http://jsfiddle.net/xSJTs/2/
$('form').on('submit',function(e){
e.preventDefault();
$.ajax({
type : "POST",
cache : false,
url : $(this).attr('action'),
data : $(this).serialize(),
success : function(data) {
$(".printArea").empty().append(data).css('visibility','visible');
}
});
});
You have to use serialize()
instead of serializeArray()
. serializeArray()
creates a JavaScript-object, serialize()
creates a query-string.
Serialize: http://api.jquery.com/serialize/
SerializeArray: http://api.jquery.com/serializeArray/
Basically you wait until the form is submitted and then you interrupt it (e.preventDefault();
).