[Solved]-Jquery ajax form success callback not being called



In case anyone had a similar problem, here’s the final javascript I ended up using:

function upload_results_dialog($data_elem){
    var $dialog_box = $("#ajax-dialog-box"),
    data = $data_elem.attr("data");
        url: "../upload/" + data+ "/",
        success: function(response){
                    title: "Upload",
                    height: 260,
                    width: 450,
                    buttons: {
                        Cancel: function(){
                        Upload: function(){
function upload($dialog_box){
    var $form = $dialog_box.find("form"),
      iframe = $dialog_box.find("iframe"),
      $html = $($iframe.contents()),
      $iframe_form = $html.find("form");

    //Set the onload function


Ok I just spent hours with this same problem going through the js file line by line. It was working one second and then the next it wasnt. My problem was – I had deleted the target div for the results. Once i put that back in, it worked fine.



Happened to me as well. Problem turned out to be the server wasn’t converting the entire object to proper JSON. Changed the return value to only the properties I needed:

return Json(new {Id = group.Id, Name = group.Name});
πŸ‘€Jeff Borden


You need to call $('#form-id').ajaxForm(); in the document ready jQuery event so the plugin registers all the event handlers.

πŸ‘€Luis Aguilar

Leave a comment