I am using Ajax with JQUERY to submit a form. For some reason I cannot seem to get the AJAX to run. The form is within a fancybox 2 modal, so I think that may have something to do with it, but I cannot figure it out. Is there something I have to do specific to making an AJAX call within a fancybox modal?
My Code: collection_create_input IS TRUE
$(".edit-post").submit(function(e) {
var dataString = $(this).serialize();
if (collection_create_input == "true") {
$.ajax({
type: "POST",
url: "checkcollection.php",
data: dataString,
async: false,
success: function(data) {
$(this).parent(".modal-content").find("#field1secondary").show();
}
});
}
e.preventDefault();
});
NOTE: