function SubmitNotification(){ //these next four lines were to check what was going on var thisData = $(this).closest('form').serialize(); console.log('begin'); console.log(thisData); console.log('end'); $.ajax({ type: "POST", url: "ajax-notify.cfm", data: $(this).closest('form').serialize(), dataType: "text", success: function(data, status) { $('#notify-alert').html(data); }, error: function(data, status) { $('#notify-alert').html(data); } });};
$(this).closest('form').serialize(); is just returning an empty string. I've found several questions about how to serialize the surrounding form of a button and this appears to be to the correct way... where is this going awry? (I've also tried $(this).parent('form') with the same issue. Incidentally, I'm not using an ID for this because there are multiple forms on the page created by a loop.) Thanks!